Explain the types of hibernate instance states.
Answer / Ekta
Hibernate Instance States are used to track the lifecycle of an object during its interaction with the database. There are three main states:n
1. Transient State: The object is not associated with any Session and has no persistent identity. It exists only in Java memory.n
2. Persistent State: The object is associated with a Hibernate Session, but it's not yet stored in the database. Modifications made to this state will be synchronized with the database when the Session is flushed or closed.n
3. Detached State: The object was originally persistent and associated with a Hibernate Session, but now it's no longer associated with any session. It exists only in Java memory and is not synchronized with the database unless re-associated with a Session.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is hibernate query object?
How many sessionfactory and session objects are usually created?
What is the difference between merge and persist in hibernate?
When was hibernate first released?
What is called lazy fetching from hibernate?
What is the difference between unidirectional and bidirectional hibernate?
What is lazy loading / lazy initialization in hibernate?
What does hibernate merge do?
Is session a thread-safe object?
Name some of the important interfaces of hibernate framework?
What is difference between save and update in hibernate?
How to configure hibernate in spring boot?