Hibernate - Interview Questions and Answers for 'Hibernate' | Search Java 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 'Hibernate' - 92 question(s) found - Order By Rating

next 30
 Q1. Can you explain integration between Spring and Hibernate ?Hibernate2020-01-06 09:27:34

 This question was recently asked at 'HCL Technologies'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve     Spring framework  Hibernate Orm     Asked in 1 Companies


 Q2. Difference between merge and update in hibernateHibernate2019-10-01 08:17:28

 This question was recently asked at 'Nucleus Software'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q3. what annotation do in background in hibernate ?Hibernate2019-09-06 08:40:25

 This question was recently asked at 'Cdac Pune'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q4. Why do we use Hibernate ?Hibernate2019-07-10 10:29:28

 This question was recently asked at 'NIIT'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q5. What is the concept of hibernate versioning ?Hibernate2019-04-04 09:20:44

 This question was recently asked at 'Tata Consultancy (TCS)'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve     hibernate versioning     Asked in 1 Companies


 Q6. Explain different inheritance mapping strategies with JPA / Hibernate.Hibernate2019-01-04 10:13:43

 This question was recently asked at 'Cognizant (CTS),HCL Technologies,Accenture,Accenture India'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve     hibernate mapping  hibernate associations     Asked in 4 Companies


 Q7. Explain Hibernate caching mechanismHibernate2018-11-14 12:53:50

Ans. Every fresh session having its own cache memory, Caching is a mechanism for storing the loaded objects into cache memory. The advantage of cache mechanism is, whenever again we want to load the same object from the database then instead of hitting the database once again, it loads from the local cache memory only, so that the no. of round trips between an application and a database server got decreased. It means caching mechanism increases the performance of the application.

In hibernate we have two levels of caching

First Level Cache [ or ] Session Cache
Second Level Cache [ or ] Session Factory Cache [ or ] JVM Level Cache

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

   Like         Discuss         Correct / Improve          Asked in 23 Companies


 Q8. Explain hibernate associations.Hibernate2018-10-30 14:59:07

 This question was recently asked at 'Ray Business Technologies'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q9. What is Entity in hibernate?Hibernate2018-10-13 09:45:18

 This question was recently asked at 'naresh i technologies'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q10. Which jar files need to be included for using Hibernate ?Hibernate2018-07-23 11:25:33

Ans. hibernate-orm
hibernate-validator
hibernate-ogm
hibernate-search

or you can download hibernate core with all dependencies.

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

   Like         Discuss         Correct / Improve     hibernate jar files   hibernate     Asked in 1 Companies


 Q11. What is the use of sql dialect ?Hibernate2018-07-23 09:43:43

Ans. Dialect means "the variant of a language".

Similarly in case of SQL Dialect we specify what dialect of SQL to be generated keeping in mind of underlying database.

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

   Like         Discuss         Correct / Improve     sql dialect  hibernate   hibernate     Asked in 2 Companies


 Q12. If your application has multiple databases, how many changes you have to made in Hibernate? Hibernate2018-07-04 16:21:07

Ans. If you have mulitple Databases you just need to add multiple configuration files and create the corresponding SessionFactory object.

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q13. What is the difference between save() and persist() in hibernate ?Hibernate2018-06-06 08:44:40

 This question was recently asked at 'IBM'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q14. Difference between Eager and Lazy loading in hibernate ?Hibernate2018-04-03 09:26:07

 This question was recently asked at 'Genpact'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q15. What is the use of second level cache in Hibernate ?Hibernate2018-02-06 20:20:18

Ans. Second level cache is shared between sessions. Hibernate by default uses first level cache. Second level cache need to be configurd to use.
There are several second level cache e.g eh cache,jboss cache etc.

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q16. What is difference between Spring jdbc template and Hibernate ?Hibernate2017-12-25 17:27:02

 This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve     Spring JDBC vs Hibernate  Spring JDBC   Hibernate


 Q17. Can you write the code for implementing the one to many (student -> courses) relationship in hibernate?Hibernate2017-09-30 07:23:32

 This question was recently asked at 'Fidelity Information Services (FIS)'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q18. What is meant by dirty object checking in hibernate ?Hibernate2017-09-26 10:33:09

Ans. Dirty Checking is one of the features of hibernate. In dirty checking, hibernate automatically detects whether an object is modified (or) not and need to be updated. As long as the object is in persistent state i.e., bound to a particular Session, Hibernate monitors any changes to the objects and executes sql.

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

   Like         Discuss         Correct / Improve     dirty checking in hibernate     Asked in 1 Companies


 Q19. Explain Hibernate Validation ?Hibernate2017-08-17 19:30:47

 This question was recently asked at 'Sofi'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve     hibernate  hibernate validation     Asked in 1 Companies


 Q20. What is the difference between JDBC, Hibernate and ODBC ?Database2017-06-18 17:52:39

 This question was recently asked at 'Oracle Argentina'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve     jdbc  odbc  hibernate  jdbc vc odbc  jdbc vs hibernate     Asked in 1 Companies


 Q21. What could be the possible cause for following exception ?

org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect):

What could be the way to fix it ?
Hibernate2017-03-29 12:44:00

Ans. This looks like the case for optimistic locking wherein hibernate suspects that the information in table was updated by some other transaction after the entity was loaded by current transaction.

One way is to have synchronized entity state and don't detach the entity. Other could be to merge the entity with the table record rather than just directly persisting the entity.

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

   Like         Discuss         Correct / Improve     StaleObjectStateException  Optimistic locking


 Q22. What is ConstraintViolationException in Hibernate ?Hibernate2017-03-22 13:13:33

Ans. The exception is thrown when a database constraint is violated.

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

   Like         Discuss         Correct / Improve     ConstraintViolationException


 Q23. What are the core interfaces in Hibernate?Hibernate2017-03-09 11:37:41

Ans. Session,SessionFactory,Configuration,Transaction,query and Criteria

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

   Like         Discuss         Correct / Improve     core interfaces of Hibernate     Asked in 1 Companies        frequent

Try 1 Question(s) Test


 Q24. What is the use of Hibernate session.evict()?Hibernate2017-03-09 09:22:58

Ans. It is used to dissociate / disconnect a particular object from the session.

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

   Like         Discuss         Correct / Improve     hibernate session evict  hibernate evict


 Q25. What is the use of Hibernate session.clear() ?Hibernate2017-03-09 09:22:22

Ans. It is used to clear the session and is used to dissociate disconnect all the objects from the session.

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

   Like         Discuss         Correct / Improve     hibernate session clear


 Q26. What is the difference between session.clear and session.evict ?Hibernate2017-03-09 09:20:44

Ans. session.clear clears all the objects from session whereas session.evict is used for evicting a particular entity.

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

   Like         Discuss         Correct / Improve     hibernate session clear  hibernate evict

Try 2 Question(s) Test


 Q27. How can we make sure that Hibernate doesn't update the entity changes to DB or how to keep the entity detached ?Hibernate2017-03-09 09:19:34

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     

Try 2 Question(s) Test


 Q28. Does Hibernate synchronize entity with the database automatically i.e any change to entity gets updated in DB ?Hibernate2017-03-09 09:17:46

Ans. Yes, the feature is there but can be override with changing the Flush Mode.

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

   Like         Discuss         Correct / Improve     


 Q29. Is it advisable to keep session or transaction open for long time just to avoid LazyInitializationException ?Hibernate2017-02-16 20:33:52

Ans. No. It's a resource and performance overhead.

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

   Like         Discuss         Correct / Improve     LazyInitializationException  Lazy Loading


 Q30. What was the worst problem you faced while working with Hibernate ?Hibernate2017-02-16 20:32:39

Ans. Lazy Initialization exceptions

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

   Like         Discuss         Correct / Improve     


next 30

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: