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