LATEST VERSION: 8.2.6 - CHANGELOG
Pivotal GemFire® v8.2

Basic Suspend and Resume Transaction Example

Basic Suspend and Resume Transaction Example

This example suspends and resumes a transaction.

 CacheTransactionManager txMgr = cache.getCacheTransactionManager();

    txMgr.begin();
    region.put("key1", "value");
    TransactionId txId = txMgr.suspend();
    assert region.containsKey("key1") == false;
    // do other operations that should not be
    // part of a transaction
    txMgr.resume(txId);
    region.put("key2", "value");
    txMgr.commit();