*/
@Test
public void testSupportsToRequiresNewCommit() {
LeanJtxWorker worker = new LeanJtxWorker(dbtxm);
DbJtxSessionProvider sessionProvider = new DbJtxSessionProvider(worker.getTransactionManager());
// session #1: supports
JtxTransaction jtx = worker.maybeRequestTransaction(supports(), CTX_1);
assertNotNull(jtx);
assertFalse(jtx.isActive());
DbSession session1 = sessionProvider.getDbSession();
executeUpdate(session1, "insert into GIRL values(1, 'Sophia', null)");
assertFalse(jtx.isActive());
assertFalse(jtx.isCommitted());
assertTrue(jtx.isNoTransaction());
// session #2: inner, required
JtxTransaction jtx2 = worker.maybeRequestTransaction(requiredNew(), CTX_2);
assertNotNull(jtx2);
DbSession session2 = sessionProvider.getDbSession();
assertNotSame(session1, session2);
executeUpdate(session2, "insert into GIRL values(2, 'Gloria', null)");
assertTrue(worker.maybeCommitTransaction(jtx2));
assertFalse(jtx2.isActive());