What is the Detached state of an object in Hibernate?

An object is in detached state if it was persistent earlier but its Session is closed now.

Any reference to this object is still valid. We can even update this object. Later on we can even attach an object in detached state to a new session and make it persistent.

Detached state is very useful in application transactions where a user takes some time to finish the work.

Leave a Reply

Your email address will not be published. Required fields are marked *