What is the way to rollback transaction if something goes wrong using hibernate api?



What is the way to rollback transaction if something goes wrong using hibernate api?..

Answer / Anurag Chandola

To rollback a transaction in Hibernate, you should use the `Session.getTransaction().rollback()` method if something goes wrong during the execution of the operation.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

What is hibernate criteria?

1 Answers  


What is cache in hibernate?

1 Answers  


What is detached object in hibernate?

1 Answers  


How to insert data into database using spring mvc and hibernate?

1 Answers  


How can we invoke stored procedures in hibernate?

1 Answers  


What is spring and hibernate framework?

1 Answers  


Why we use hibernate instead of jdbc?

1 Answers  


Which method is used to remove a persistent instance from the datastore?

1 Answers  


What is the difference between get and load in hibernate?

1 Answers  


What is criteria in hibernate?

1 Answers  


How to implement joins in hibernate?

1 Answers  


How components are used in hibernate?

1 Answers  


Categories