Hibernate - Interview Questions and Answers for 'Rollback' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Hibernate - Interview Questions and Answers for 'Rollback' - 2 question(s) found - Order By Rating

 Q1. What is the purpose of Commit and Rollback in Databases ?Database
Ans. When a DML is executed, the changes only stays in session and still not pushed to DB Tables, Commit is used to push those changes to the Tables.

In case we realize that we don't want to commit those changes and would like to ignore them, we can use rollback.

For example - You may like that for a banking transaction you would like to update the account balance only if the debit or credit record was correctly inserted, so you may like to encapsulate both DML's - insert for transaction and update for balance in a single transaction and would only commit if both succeeds else rollback.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     databases  commit  rollback     Asked in 2 Companies      Basic


Related Questions

 What is ACID ?
  What is database deadlock ? How can we avoid them?
  What things you would care about to improve the performance of Application if its identified that its DB communication that needs to be improved ?
  If you are given a choice to implement the code to either Insert a Record or Update if already exist, Which approach will you follow ?
  What is the use of @GeneratedValue annotation in Hibernate?
  What are temp tables ?
 What is a Database Trigger ?
 What is database Normalization ?
 What happens to backups if we delete the RDS instance ?
  What is a Cursor ?


 Q2. What is the way to rollback transaction if something goes wrong using hibernate API ? Hibernate
Ans. We can have the code calling Hibernate API within try block and can have transaction.rollback within Catch.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate   hibernate rollback


Related Questions

  What is Lazy Initialization in Hibernate ?
  What are the ways to avoid LazyInitializationException ?
  Difference between first level and second level cache in hibernate ?
  Which annotations are used in Hibernate ?
  What are the contents of Hibernate configuration file ( hibernate.cfg.xml ) ?
  What things you would care about to improve the performance of Application if its identified that its DB communication that needs to be improved ?
  How to configure second level cache in Hibernate ?
  What is the use of @GeneratedValue annotation in Hibernate?
 What are the disadvantages of Hibernate over native APIs ?
  What are the advantages of Hibernate ?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: