session.recallTransactionState();
}
if (userConnection != null) {
Connection conn = userConnection;
session.saveTransactionState();
session.setTransaction(new UserProvidedTransaction(conn));
session.setTransactionState(TransactionState.STATE_USER_PROVIDED);
} else {
session.setTransaction(null);
session.closePreparedStatements();
session.reset(); // used to be pushSession, which is probably incorrect.