1 Reply Latest reply on Mar 22, 2003 10:39 AM by slaboure

    Bean is always being invalidated because of CMP bug

    thammoud

      Hello,

      This message was cross-posted in the cluster forum to inform the authors of an affected subsystem.

      When we have an entity with an cache-invalidation set
      to true. The problem is that it is being invalidated in every transaction. Clearly not what we want. The bean is not configured to be read-only.

      Debugging through the container, I found the following:

      EntityBeanCacheBatchInvalidatorInterceptor has a changed() method that calls the container.getPersistenceManager().isModified(). In turn, the CMPPersistenceManager's isModified calls JDBCStoreManager-->isModifiedCommand.execute(ctx) which is hardcoded
      to return true.

      However, when the container itself does not use the isModified when it saves and enity. It uses a dirty list to determine whether the bean needs to be persisted.
      Look at JDBCStoreEntityCommand which uses the dirty list.

      I have changed a local copy of the JDBCIsModifiedCommand to use the code in JDBCStoreEntityCommand and it works like a charm.

      How do we get fix into the system ?

      Tarek Hammoud

      P.S I am using code from CVS updated 3 days ago. 3.2 branch. Using JDK1.4.1 on linux