try {
Transaction ts = getTransactionManager().getTransaction();
if (ts == null || !ts.isTransactionStarted()) {
throw new TransactionException("getConnection() failed: no started transaction.");
}
conn = ts.getConnection(connectionName);
if (conn == null) throw new CreateConnectionFailureException("getConnection() failed to create a connection.");