0 Replies Latest reply on Jun 11, 2003 3:17 PM by Johannes Weidl-Rektenwald

    Cache Invalidation

    Johannes Weidl-Rektenwald Newbie


      I have a subtle problem with cache invalidation. I modified the downloadable test program "template" a little bit so that I can modify a "BookEntity" (which resembles a "TestEntity" but holds a book's data). I also read the article under http://www.onjava.com/pub/a/onjava/2003/05/28/jboss_optimization.html and configured my jboss.xml in the way:

      <configuration-name>Standard CMP 2.x EntityBean with cache invalidation</configuration-name>



      When I change the book title on node A (via a session bean, that calls the entity bean's method "updateValueObject" which calls setTitle() in turn), I receive the following message on node B:

      2003-06-12 20:53:33,257 DEBUG [org.jboss.ha.framework.interfaces.HAPartition.DefaultPartition] Partition DefaultPartition received msg
      2003-06-12 20:53:33,291 DEBUG [org.jboss.ha.framework.interfaces.HAPartition.DefaultPartition] pre methodName: DCacheBridge-DefaultJGBridge._rpc_batchInvalidate
      2003-06-12 20:53:33,291 DEBUG [org.jboss.ha.framework.interfaces.HAPartition.DefaultPartition] handlerName: DCacheBridge-DefaultJGBridge methodName: _rpc_batchInvalidate
      2003-06-12 20:53:33,292 DEBUG [org.jboss.ha.framework.interfaces.HAPartition.DefaultPartition] Handle: DCacheBridge-DefaultJGBridge._rpc_batchInvalidate

      When I search for the book with the new title on node B, I find the book, but when I write the book data to the console, the OLD (!!!!) title is shown. The entity bean is read from the cache, no ejbLoad() method is triggered. When I search for all books with the findAll() method, I also see the old (stale) book title.

      So how does the new book title come from node A to node B? Why does the output on node B still produce the stale data? Why is the entity bean not loaded from the database?

      I do not use any transaction code other than the xdoclet directive * @ejb:transaction type="Required".

      Can you help me?

      Best regards from Austria,