getTransaction(), beginTransaction() and getIdentifier() in Hibernate

Transaction object can be created by 2 ways

getTransaction(): Returns the Transaction object associated with current session. It returns the same Transaction object for every request.

We need to call begin() method on Transaction object to start the transaction.

beginTransaction(): Returns different transaction objects. For each and every request transaction object creates a~lcl
begins new transaction context.

getIdentifier(): Use to find the object identifier value at run-time.

 

 

Posted in hibernate and tagged , , , , .

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">