Session session = null;
Transaction tx = null;
/*
*
*/
try {
session = getHibernateTemplate().getSessionFactory().openSession();
tx = session.beginTransaction();
/*
*
*/
tx.commit();
} catch (Exception e) {
tx.rollback();
e.printStackTrace();
}
finally {
if(session!=null)
session.close();
}
声纳在If块(if(session!= null))中给出了错误,该错误会更改此条件,以使其始终不等于“ true”。如何解决这个问题?