Please send your Questions & Answers or Feedback to ""

What is getTransaction method ?

getTransaction : get the Transaction instance associated with this session..
    Transaction tx = session.beginTransaction();
suppose if we are not assigning Transaction object to any reference then how to commit the transaction.
In the second case we are not assigning the Transaction object to any reference so we are using the getTransaction to commit it.
Suppose if we are not starting any transaction then we cannot get the transaction object from the session.It will throw
    TransactionException -- Transaction not successfully started.
        note : using Session , we can get the Connection,SessionFactory and the Transaction.
Related Posts Plugin for WordPress, Blogger...
Flag Counter