public static void rollbackTransaction() {
Transaction tx = (Transaction) threadTransaction.get();
try {
threadTransaction.set(null);
if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ) {
tx.rollback();
}
} catch (HibernateException e) {
logger.error("Exception " + e.getMessage(), e);
throw new PersistException(e);