transactionManager.commit();
assertTrue("Expected committed", committed);
}
public void testTransactionUnshareableConnection() throws Exception {
TransactionManager transactionManager = new TransactionManagerImpl();
ContainerTransactionContext transactionContext = new ContainerTransactionContext(transactionManager);
TransactionContext.setContext(transactionContext);
transactionContext.begin();
ConnectionInfo connectionInfo = makeConnectionInfo();
connectionInfo.setUnshareable(true);
transactionEnlistingInterceptor.getConnection(connectionInfo);
assertTrue("Expected started", started);
assertTrue("Expected not ended", !ended);
started = false;
transactionEnlistingInterceptor.returnConnection(connectionInfo, ConnectionReturnAction.RETURN_HANDLE);
assertTrue("Expected not started", !started);
assertTrue("Expected ended", ended);
assertTrue("Expected returned", returned);
transactionManager.commit();
assertTrue("Expected committed", committed);
}