Code:
try{
threadTransaction.set(null);
if(tx!=null&&!tx.wasCommited()&&!tx.wasRolledBack())
tx.commit();
threadTransaction.set(null);
}catch(HibernateException ex){
rollbackTransaction();
throw new InfrastructureException(ex);
}
the first threadTransaction.set(null) is invalid because then you can't rollback. There will be nothing to rollback if the commit fails. Should the second threadTransaction.set(null) be within the if as the indentation suggests or outside of it as the braces suggest?
--Angus