Singleton in extension for cache not working
Question

Hi guys

I have created a singleton in my extension in other Cache queries.

What I realize is that when I call the extension from my Outsystems application, it creates a new instance of the class. Can anyone help me with this.

Is there another way to use Cache in extension. 


As I understand this correct, you need a way to cache the result from your extension?

In that case, you can wrap it in a User Action / Server Action and set the cache property of this action to the length that you prefer. Inside this action you call your extension's action. Whenever the system calls your user action with parameter values that have been used before, it will return the cached result and not execute your extension's action again.

Lennart Kraak wrote:

As I understand this correct, you need a way to cache the result from your extension?

In that case, you can wrap it in a User Action / Server Action and set the cache property of this action to the length that you prefer. Inside this action you call your extension's action. Whenever the system calls your user action with parameter values that have been used before, it will return the cached result and not execute your extension's action again.

We try this way but the action only cached on the same request not all application user requests.


Hi thanks for your reply. But what I want is to cache the result from a query that is executed inside of a method in extension. This method can only be called inside the extension.  

Hi Amélio Chissico,


Have you found an answer on this? I need to do the same in my code. I have a Redis Connection need to be pooled.

Facing this issue exactly, did you find a way to do it?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.