• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CACHE INVALIDATION IN WEBLOGIC ??

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to BEA/Weblogic forum...
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic