hibernate1

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 […]