Package org.infinispan.transaction.xa

Examples of org.infinispan.transaction.xa.TransactionTable$StaleTransactionCleanup


      tm1.begin();
      cache1.putForExternalRead(key, value);
      tm1.commit();
      replListener2.waitForRpc();

      TransactionTable tt1 = TestingUtil.extractComponent(cache1, TransactionTable.class);
      TransactionTable tt2 = TestingUtil.extractComponent(cache2, TransactionTable.class);

      assert tt1.getRemoteTxCount() == 0 : "Cache 1 should have no stale global TXs";
      assert tt1.getLocalTxCount() == 0 : "Cache 1 should have no stale local TXs";
      assert tt2.getRemoteTxCount() == 0 : "Cache 2 should have no stale global TXs";
      assert tt2.getLocalTxCount() == 0 : "Cache 2 should have no stale local TXs";

      System.out.println("PutForExternalReadTest.testMemLeakOnSuspendedTransactions");
      replListener2.expectWithTx(PutKeyValueCommand.class);
      tm1.begin();
      cache1.putForExternalRead(key, value);
      cache1.put(key, value);
      tm1.commit();
      replListener2.waitForRpc();

      assert tt1.getRemoteTxCount() == 0 : "Cache 1 should have no stale global TXs";
      assert tt1.getLocalTxCount() == 0 : "Cache 1 should have no stale local TXs";
      assert tt2.getRemoteTxCount() == 0 : "Cache 2 should have no stale global TXs";
      assert tt2.getLocalTxCount() == 0 : "Cache 2 should have no stale local TXs";

      replListener2.expectWithTx(PutKeyValueCommand.class);
      tm1.begin();
      cache1.put(key, value);
      cache1.putForExternalRead(key, value);
      tm1.commit();
      replListener2.waitForRpc();

      assert tt1.getRemoteTxCount() == 0 : "Cache 1 should have no stale global TXs";
      assert tt1.getLocalTxCount() == 0 : "Cache 1 should have no stale local TXs";
      assert tt2.getRemoteTxCount() == 0 : "Cache 2 should have no stale global TXs";
      assert tt2.getLocalTxCount() == 0 : "Cache 2 should have no stale local TXs";

      replListener2.expectWithTx(PutKeyValueCommand.class, PutKeyValueCommand.class);
      tm1.begin();
      cache1.put(key, value);
      cache1.putForExternalRead(key, value);
      cache1.put(key, value);
      tm1.commit();
      replListener2.waitForRpc();

      assert tt1.getRemoteTxCount() == 0 : "Cache 1 should have no stale global TXs";
      assert tt1.getLocalTxCount() == 0 : "Cache 1 should have no stale local TXs";
      assert tt2.getRemoteTxCount() == 0 : "Cache 2 should have no stale global TXs";
      assert tt2.getLocalTxCount() == 0 : "Cache 2 should have no stale local TXs";
   }
View Full Code Here

TOP

Related Classes of org.infinispan.transaction.xa.TransactionTable$StaleTransactionCleanup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.