0 Replies Latest reply on Sep 1, 2004 11:08 AM by peterbakker

    cache invalidation within transaction

    peterbakker

      There is a bug #843675 which describes the fact that cache invalidation must run within a transaction. Now I have the following situation.

      I have a servlet that executes method A on a stateless session bean. Method A has transaction attribute not supported. Method A calls method B several times. Method B has transaction attribute requires new.

      In method B an entity bean is created (or updated). At that point the following exception is thrown:

      2004-09-01 16:26:27,628 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:
      java.lang.NullPointerException
      at org.jboss.cache.invalidation.InvalidationsTxGrouper.registerInvalidationSynchronization(Ljavax.transaction.Transaction;Lorg.jboss.cache.invalidation.InvalidationGroup;Ljava.io.Serializabl
      e;)V(InvalidationsTxGrouper.java:76)
      at org.jboss.cache.invalidation.triggers.EntityBeanCacheBatchInvalidatorInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(EntityBeanCacheBatchInvalidatorInterceptor.jav
      a:106)
      ....

      If I change the transaction attribute of method A to required, everthing works fine.

      In my opinion in both situations method B runs within a transaction. So how can I have the different results? Is seems releted to the bug.

      Peter.