@Test
  public void testNoCallbacksOnTransactionWriterThrow() throws Exception {
    installCacheListenerAndWriter();

    txMgr.setWriter(new TransactionWriter() {
      @Override
      public void beforeCommit(TransactionEvent event) throws TransactionWriterException {
        throw new TransactionWriterException("Rollback now!");
      }

      @Override
      public void close() {}
    });

    installTransactionListener();

    txMgr.begin();
    region.create("key1", "value1");
    cbCount = 0;
    try {
      txMgr.commit();
      fail("Commit should have thrown CommitConflictException");
    } catch (CommitConflictException cce) {
      assertNotNull(cce.getCause());
      assertTrue(cce.getCause() instanceof TransactionWriterException);
    }
    assertEquals(0, cbCount);

    cbCount = 0;
    region.create("key1", "value1");
    // do a sanity check to make sure callbacks are installed
    assertEquals(2, cbCount); // 2 -> 1writer + 1listener

    txMgr.begin();
    region.put("key1", "value2");
    cbCount = 0;
    try {
      txMgr.commit();
      fail("Commit should have thrown CommitConflictException");
    } catch (CommitConflictException expected) {
      assertNotNull(expected.getCause());
      assertTrue(expected.getCause() instanceof TransactionWriterException);
    }
    assertEquals(0, cbCount);
    region.localDestroy("key1");

    region.create("key1", "value1");
    txMgr.begin();
    region.localDestroy("key1");
    cbCount = 0;
    try {
      txMgr.commit();
      fail("Commit should have thrown CommitConflictException");
    } catch (CommitConflictException expected) {
      assertNotNull(expected.getCause());
      assertTrue(expected.getCause() instanceof TransactionWriterException);
    }
    assertEquals(0, cbCount);

    region.put("key1", "value1");
    txMgr.begin();
    region.destroy("key1");
    cbCount = 0;
    try {
      txMgr.commit();
      fail("Commit should have thrown CommitConflictException");
    } catch (CommitConflictException expected) {
      assertNotNull(expected.getCause());
      assertTrue(expected.getCause() instanceof TransactionWriterException);
    }
    assertEquals(0, cbCount);

    region.put("key1", "value1");
    txMgr.begin();
    region.localInvalidate("key1");
    cbCount = 0;
    try {
      txMgr.commit();
      fail("Commit should have thrown CommitConflictException");
    } catch (CommitConflictException expected) {
      assertNotNull(expected.getCause());
      assertTrue(expected.getCause() instanceof TransactionWriterException);
    }
    assertEquals(0, cbCount);
    region.localDestroy("key1");

    region.put("key1", "value1");
    txMgr.begin();
    region.invalidate("key1");
    cbCount = 0;
    try {
      txMgr.commit();
      fail("Commit should have thrown CommitConflictException");
    } catch (CommitConflictException expected) {
      assertNotNull(expected.getCause());
      assertTrue(expected.getCause() instanceof TransactionWriterException);
    }
    assertEquals(0, cbCount);

    region.localDestroy("key1");
  }
make sure standard Cache(Listener,Writer) are not called during rollback due to transaction
writer throw
geode-core/src/integrationTest/java/org/apache/geode/TXWriterJUnitTest.java