use of com.ctrip.platform.dal.exceptions.TransactionSystemException in project dal by ctripcorp.
the class DalTransaction method cleanup.
private void cleanup(boolean commit) {
Connection conn = connHolder.getConn();
if (commit) {
try {
conn.commit();
} catch (SQLException ex) {
throw new TransactionSystemException("Could not commit JDBC transaction", ex);
}
} else {
try {
conn.rollback();
} catch (SQLException ex) {
logger.error("Could not roll back JDBC transaction", ex);
}
}
try {
conn.setAutoCommit(true);
} catch (Throwable e) {
logger.error("Can not setAutoCommit on current connection", e);
}
connHolder.close();
DalTransactionManager.clearCurrentTransaction();
}
Aggregations