Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OSB, Java Callout, static variables and classloaders

Pierluigi VernettoJun 28 2011 — edited Jul 1 2011
We have a huge (10,000 element) lookup table to enrich a payload.
We have tried to store it in Coherence cache and query it with XQuery, but performance is unacceptable and memory impact is huge,
also because XQuery doesn't allow you to create indexes on a XML document for fast searches (correct me if I am wrong).

So we are thinking of storing the whole table in a Java class as a:
static HashMap<String, XmlObject> cache = new HashMap<String, XmlObject>();

where the String is a unique key for the table (an id).

and when I need a specific element I use a lookup:

public static XmlObject lookupElement(String id) {
return cache.get(id);
}

We initialize the cache with a static init(XmlObject[] objectsToCache).


My question is:
the Java class we use as a cache container will not be garbage collected at some point in time, leaving us with no cache at all?
Also, if this Java class is accessed within a Proxy Service which is implemented as a MDB (an independent Enterprise application deployed in WebLogic with a ejb.jar module),
the classloader will not be different, hence a new instance of the class will be accessed?

My guess is that all other Proxy Services - I mean other than MDBs - are "deployed" - in fact interpreted at runtime - in the same Enterprise Application as ALSB Routing (or some other EAR starting with ALSB)...

If you deem too risky this approach of using static variables in a Java class as cache containers, which other pattern can I use?
This solution seems extremely fast.... performance is a great concern here. We cannot afford to have to marshal/unmarshal stuff or making a service invocation for each lookup.

Thank you soooo much!
pierre
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 29 2011
Added on Jun 28 2011
5 comments
1,371 views