1 Reply Latest reply on Jun 12, 2012 12:01 PM by carmelo aprile

    Infinispan does not enlist transaction

    carmelo aprile Newbie

      Hi, I have a probem with infinispan inside jboss AS 7.

       

      <cache-container name="myCacheContainerMappedName"

                      default-cache="serialRunningSessions" jndi-name="java:jboss/myCacheContainerMappedName"

                      start="EAGER">

                      <transport lock-timeout="60000" />

                      <replicated-cache name="serialRunningSessions"

                          mode="SYNC" batching="true">

                          <locking isolation="REPEATABLE_READ" />

                          <transaction mode="NON_DURABLE_XA" />

                      </replicated-cache>

       

      .................

       

      @Stateless

      @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)

      public class MyCacheManagerBean implements MyCacheManager{

       

      @Resource(mappedName = "java:jboss/myCacheContainerMappedName")

          private EmbeddedCacheManager container;

      ................

       

      LoadingSession oldSession = (LoadingSession) container.getCache().putIfAbsent(session.getLoadingCacheKey(), session);

      .............

       

       

      }

       

      I have this cache configuration. During my elaboration I put an object into this cache inside an EJB method , the transaction attribute of the EJB is REQUIRES_NEW.

      If the transaction is rollback the object that I put into the infispan cache stay into the cache.

      What is the problem?

      If the container transaction si rollback, why infispan cache keep the object ?

       

      Thanks in advance