Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

Explain Hibernate Transaction API?
The Transaction interface provides methods for declaring the boundaries of a database transaction.
Example:
Session s = sessions.openSession();
Transaction t = null;
try{
   t = s.beginTransaction();
   concludeAuction();
    t.commit();
   } catch(Exception e) {
      if(t!=null) {
         try{
            t.rollback();
            } catch (HibernateException h) {
               // log h and rethrow e
            }
       }
       throw e;
}finally {
   try{
      s.close();
      } catch (HibernateException h) {
         throw h;
      }
}
Posted By: Name:Rajesh Kr URL: Explain Hibernate Transaction API?