I am using OPA 10.2 and I want to connect to database to fetch values into dropdown. I have implemented ListProviderPlugin in java for the same. However, the implementation of ListProviderPlugin interface makes connection to database for each and every dropdown. This results into exhaustion of connection pool and is not able to get connection.
Is there any way to get the connection only once and use the object through out the application? Can we create objects on application level?
I should be able to use this connection object in other event handlers also.
In OPA 10.4 a new Rulebase Listener plug-in API was added. This is invoked once when the rulebase is loaded, so any shared data can be read and cached at that time, and then retrieved from memory by, for example, each time a list provider needs it.
In 10.2, you can effectively do the same thing yourself by caching the information the first time the list-provider is invoked, then reusing it from cache on subsequent calls to the list-provider. The reason it does not behave this why by default is that it is possible for the contents of the list to change dynamically.