} else {
<BUG>log.warn("Session is null, cannot close");
</BUG>
}
}
<BUG>public static void rollbackTransaction(Transaction tx) {
</BUG>
if (tx != null) {
try {
<BUG>log.error("Failed to commit transaction, attempting rollback...");
</BUG>
tx.rollback();

} else {
LOG.error("No Session available - SessionFactory is null.");
}
return session;
}
public static void closeSession(Session session) {
if (session != null) {
try {
session.close();
