DEV Community

Tech Community for Software AG Tech Community

Posted on • Originally published at tech.forums.softwareag.com on

ERROR: null" or "null pointer exception while invoking FlowService - Storage get operation

In this post, we’ll talk about a problem that developers face when multiple “get” operations are involved in a FlowService.

The typical scenario is as follows: the first “get” operation is successful during runtime, but subsequent “get” operations result in a null pointer exception. This still occurs even if a list operation shows that both keys are being fetched from the same data store. The error message “ERROR: null” or “null pointer exception” will appear on the screen if the user tries to use more than one storage “get.”

For a better understanding, let’s learn some facts about the “get” operation:

The “get” operation retrieves a value from a data store and locks the entry and the data store on behalf of the thread that invoked the operation.

Why does the operation lock the data store along with the entry?

This is done when the thread has the entry locked to prevent another thread from deleting the data store and the entries it contains.

This operation does not automatically release the lock on the data store or entry after performing the “get” operation. You need to ensure that the lock is released by calling the put or unlock operations. If you do not release the lock, webMethods.io Integration will release the lock at the end of the FlowService execution.

The solution to the problem of not being able to use several “get” operations in a single flow is as follows:

If you unlock the data store just after using the “get” operation, you should be able to use multiple “get” operations in a single flow.

You need to make sure to unlock the entry just after each “get” call so that it does not give that error. This will allow you to use “get” calls on other entries in the same store. By unlocking the entry, you’ll also unlock the datastore, allowing you to use “get” calls on other entries.

In a nutshell, if you’re facing an issue with the Storage “get” action failing during runtime, the solution is to explicitly unlock the entry just after each “get” operation by using the “ unlock ” operation. This way, you’ll be able to use multiple “get” operations in a single flow without encountering null pointer exceptions or other errors.

To know more about Storage services please follow below link:

FlowServices - webMethods.io Integration

Hope this helps.

Cheers!

Read full topic

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay