hi,
I am using a begin transaction and commit transaction if the commit fails
i am not calling the rollback() method. if the commit fails will the entire Session for the entire application will be closed. or the session will be there for using it in other methods in the application.
This is my code example,
public void saveBankValue(
BankValue persistentInstance) {
log.debug("save BankValue instance");
try {
sessionFactory.getCurrentSession().beginTransaction();
sessionFactory.getCurrentSession().save(persistentInstance);
sessionFactory.getCurrentSession().getTransaction().commit();
log.debug("save successful");
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
-------------------------------------------------
see there is no rollback() in catch block. will this close the session when commit fails and effect other methods in the class which uses the same session factory
please give me an answer on this.
Thanks,
Joseph.C
_________________ JosephC
|