[infinispan-dev] Issue with transaction rollback

Faseela K faseela.k at ericsson.com
Sat Nov 9 14:31:26 EST 2013


Hi,

   The issue I mentioned below was not related to nested transactions.
   I debugged further, and the issue narrowed down to the following:

      EmbeddedCacheManager manager = new DefaultCacheManager("config/infinispan-config.xml");
      Configuration rc = manager.getCacheConfiguration("transaction");
      manager.defineConfiguration("test1", rc);
      ConcurrentMap<String, Rollback> cache1 = manager.getCache("test1");
      TransactionManager tm = manager.getCache("transaction").getAdvancedCache().getTransactionManager();
      Rollback t1 = new Rollback("k1", "v1");
      cache1.put("k1", t1);
      tm.begin();
      Rollback tmp = cache1.get("k1");
      tmp.setName("abcd");
      cache1.replace("k1", tmp);
      tm.rollback();

      Even after doing the rollback, "k1" still points to name "abcd".
      Only if I do a cache1.get("k1").clone(), rollback is functioning as expected.

Thanks,
Faseela



________________________________
From: infinispan-dev-bounces at lists.jboss.org [mailto:infinispan-dev-bounces at lists.jboss.org] On Behalf Of Faseela K
Sent: Friday, November 08, 2013 6:39 PM
To: infinispan -Dev List
Subject: [infinispan-dev] Issue with nested transactions

Hi,

  I have two osgi bundles, both having two separate caches.
  I explicitly started a transaction in Bundle 1.
  Within the transaction, I am accessing Bundle 2's cache(this is implicit transaction, since autocommit is true), and modifying it.
  Now, there is some operation on Bundle 1's cache done.
  After this operation, if I do a roll back,  Only Bundle 1's cache operations are getting rolled back.
  I am not getting any error, though.
  Does anyone know why this happens?

  Steps :

    1) Bundle 1 - transaction started
    2) update bundle 2 cache
    3) update bundle 1 cache
    4) Bundle 1 - transaction rollback

    Issue : bundle 2 cache not rolled back!!

Thanks,
Faseela

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20131109/5a8acd08/attachment.html 


More information about the infinispan-dev mailing list