@Test
  public void testAfterCommitFailedOnTransactionWriterThrow() 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 expected) {
      assertNotNull(expected.getCause());
      assertTrue(expected.getCause() instanceof TransactionWriterException);
    }
    assertEquals(0, cbCount);
    assertEquals(1, failedCommits);
    assertEquals(0, afterCommits);
    assertEquals(0, afterRollbacks);
  }
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