[infinispan-issues] [JBoss JIRA] Created: (ISPN-1062) Cannot enroll 2 cache instances in the same global Tx

Nicolas Filotto (JIRA) jira-events at lists.jboss.org
Tue Apr 19 15:48:43 EDT 2011


Cannot enroll 2 cache instances in the same global Tx
-----------------------------------------------------

                 Key: ISPN-1062
                 URL: https://issues.jboss.org/browse/ISPN-1062
             Project: Infinispan
          Issue Type: Bug
          Components: Transactions
    Affects Versions: 5.0.0.BETA2, 5.0.0.BETA1
            Reporter: Nicolas Filotto
            Assignee: Manik Surtani
            Priority: Critical
         Attachments: TestMultiCacheInstances.java

It seems that there is a regression since ISPN 5.0.0, the method isSameRM returns null even for 2 different cache instances which has for side effect to make ISPN forget to commit the changes on the second cache and more important to release the locks that have been acquired during the Tx.

The following code fails on ISPN 5.0.0 but passes on ISPN 4.2.1.FINAL (with a real TM like Arjuna)
{code:java}
   public void testUpdate() throws Exception
   {
      Cache<String, String> cache1 = manager.getCache("cache1");
      Cache<String, String> cache2 = manager.getCache("cache2");
      assertFalse(cache1.containsKey("a"));
      assertFalse(cache2.containsKey("b"));
      TransactionManager tm = cache1.getAdvancedCache().getTransactionManager();
      tm.begin();
      cache1.put("a", "value1");
      cache2.put("b", "value2");
      tm.commit();
      assertEquals("value1", cache1.get("a"));
      assertEquals("value2", cache2.get("b"));
      tm.begin();
      cache1.remove("a");
      cache2.remove("b");
      tm.commit();      
      assertFalse(cache1.containsKey("a"));
      assertFalse(cache2.containsKey("b"));
   }
{code}

Find as attached file the full unit test

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list