Multiple choice technology web technology

Which one of the following will commit session?

  1. session..commit()

  2. session.getCommitTransaction()

  3. session.getTransaction().commit()

  4. session.getTransaction().save()

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

To commit a transaction in Hibernate, you must call session.getTransaction().commit(). This retrieves the current Transaction object associated with the session and commits it. The other options don't represent valid Hibernate API methods.