ContactUs

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

What's transaction management in hibernate? How it works?

Transaction management is the process of managing a set of statements or commands. In hibernate; transaction management is done by transaction interface as shown in below code:

Session s = null;

Transaction tr = null;

try {

s = sessionFactory.openSession();

tr = s.beginTransaction();

doTheAction(s);

tr.commit();

} catch (RuntimeException exc) {

tr.rollback();

} finally {

s.close();

}

Related Posts Plugin for WordPress, Blogger...
Flag Counter