Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1062

Cannot enroll 2 cache instances in the same global Tx

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 5.0.0.CR2
    • 5.0.0.BETA1, 5.0.0.BETA2
    • Transactions
    • None

    Description

      It seems that there is a regression since ISPN 5.0.0, the method isSameRM returns true 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)

         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"));
         }
      

      Find as attached file the full unit test

      Attachments

        Activity

          People

            mircea.markus Mircea Markus (Inactive)
            nfilotto Nicolas Filotto (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: