How can we make sure that Hibernate doesn't update the entity changes to DB or how to keep the entity detached ?
Questions
Search
List By Company
List By Topic
Legacy
Tests
Repository
DashBoard
Java
Java 8
Java 7
Java Abbreviations
OCJP / SCJP
Class List
New in Java 8
Java Exceptions
Spring Exceptions
Java Enums
Java 8 Lambda
Java 8 java.time
Big Data
Best Of Java
Discussion
Search
Subscribe
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
Search
Submit Question
Interview Questions and Answers
Q1.
How can we make sure that Hibernate doesn't update the entity changes to DB or how to keep the entity detached ?
Hibernate
Ans. If it's only a read only transaction, we can wrap the get / load call in read only transaction.
If we want it to be application wide, we an set the flush mode accordingly or else we can evict the entity object to remove them from session.
Help us improve. Please let us know the company, where you were asked this question
:
Like
Discuss
Correct / Improve
 
Correction
Duplicate of Another Question
Company where this question was Asked
Suggestion
Try 2 Question(s) Test
Which of the following session method is used to disassociate / disconnect all objects from the session
Clear
Evict
Close
Merge
Which of the following session method is used to disassociate / disconnect a particular object / entity from the session
Clear
Evict
Close
Merge
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: