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 first retrieve the active transaction from the session and then call its commit method using session.getTransaction().commit(). The other options are syntactically incorrect or do not exist.