private void doNonTxInvalidateRegionOp(CachePerfStats stats) throws Exception {
    long txRollbackChanges = stats.getTxRollbackChanges();
    region.create("key1", "value1");
    region.create("key2", "value2");
    txMgr.begin();
    try {
      region.localInvalidateRegion();
      fail("Should have gotten an UnsupportedOperationInTransactionException");
    } catch (UnsupportedOperationInTransactionException ee) {
      // this is expected
    }
    txMgr.rollback();
    assertEquals("value1", region.get("key1"));
    assertEquals("value2", region.get("key2"));
    assertEquals(txRollbackChanges, stats.getTxRollbackChanges());

    region.put("key1", "value1");
    region.put("key2", "value2");
    txMgr.begin();
    try {
      region.invalidateRegion();
      fail("Should have gotten an UnsupportedOperationInTransactionException");
    } catch (UnsupportedOperationInTransactionException ee) {
      // this is expected
    }
    txMgr.rollback();
    assertEquals("value1", region.get("key1"));
    assertEquals("value2", region.get("key2"));
    assertEquals(txRollbackChanges, stats.getTxRollbackChanges());

  }
Tests basic transaction functionality

@since GemFire 4.0
geode-core/src/integrationTest/java/org/apache/geode/TXJUnitTest.java