aspose file tools*
The moose likes BEA/Weblogic and the fly likes CACHE INVALIDATION IN WEBLOGIC ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "CACHE INVALIDATION IN WEBLOGIC ??" Watch "CACHE INVALIDATION IN WEBLOGIC ??" New topic
Author

CACHE INVALIDATION IN WEBLOGIC ??

Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
I am using weblogic 8.1 and developed entity beans. I cached them by adding properties in the deployment descriptor. I made them read-only and invalidated them whenever there are changes to the data. it did work fine.

I implemented invalidation of the home interface using the following logic

import javax.naming.InitialContext;
import weblogic.ejb.CachingHome;

Context initial = new InitialContext();
Object o = initial.lookup("CustomerEJB_CustomerHome");
CustomerHome customerHome = (CustomerHome)o;

CachingHome customerCaching = (CachingHome)customerHome;
customerCaching.invalidateAll();



Invalidation worked fine in weblogic 8.1

-----------------------------------------

I tried to migrate the same code to weblogic 6.1 ( currently our production runs in weblogic 6.1 SP1). I had to make changes to deployment descriptors for this version , but was able to EJB compile and deploy the application.

But whenever i do invalidate for changes, it seems to be invalidating, no errors. But it still fetches the old data. I dont get to see the new data, that i modified. The entity bean seems to be calling ejbStore() and ejbLoad(), but somehow does not get the modified data.

I think i am making some mistake, but everything looks good to me and i have no clue what changes i need to make to get this working.

Is this a feature not supported in weblogic 6.1 ?

Any help in this ???

[ January 18, 2005: Message edited by: Mohen Vijay ]
[ January 18, 2005: Message edited by: Mohen Vijay ]
Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
well, i found the solution.

weblogic 6.1 SP1 needs this element to be set as FALSE in weblogic-ejb-jar.xml

<finders-load-bean>false</finders-load-bean>

For weblogic 8.1, this is not mandatory to specify. Invalidating the home interface works fine even without providing this property .
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Moving to BEA/Weblogic forum...


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Originally posted by Mohen Vijay:
well, i found the solution.

weblogic 6.1 SP1 needs this element to be set as FALSE in weblogic-ejb-jar.xml

<finders-load-bean>false</finders-load-bean>



Hope you are aware that setting this to false means your finder performance is going to get worse since it will suffer from the (n+1) calls problem.
I dont know why setting this to false makes invalidation work.

And btw, if i remeber correctly, in WL 8.1, finder-load-bean is true by default so why would you want to set it to false in WL 6.1?
Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
Well, the only reason i am setting it to FALSE is , that is the only reason invalidation works.

I have no clue why this (finder-load-bean) parameter affects the invalidations stuff. But in Weblogic 6.1, if i do not add this one, invalidation does not work .

Yes, in weblogic 8.1, this is defaulted to TRUE.

I do not have the answer how is parameter affects the invalidation.

But its a read only bean that is cached and does not access database unless the data changes.
[ January 27, 2005: Message edited by: Mohen Vijay ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: CACHE INVALIDATION IN WEBLOGIC ??