Share on Google+Share on Google+

1 Answer(s)      6 years and a month ago
Posted in : Hibernate

what is detached object? what is transient object?

View Answers

August 3, 2011 at 10:24 AM

Detached Object

A detached object is an object that has been persistent, but its Session has been closed. The reference to the object is still valid, of course, and the detached instance might even be modified in this state. A detached instance can be reattached to a new Session at a later point in time, making it (and all the modifications) persistent again.

Transient object

Transient objects do not have association with the databases and session objects. They are simple objects and not persisted to the database. Once the last reference is lost, that means the object itself is lost. And of course , garbage collected. The commits and rollbacks will have no effects on these objects. They can become into persistent objects through the save method calls of Session object.


Related Tutorials/Questions & Answers:
scwcd - WebSevices
scwcd  Hi RoseIndia, sub: scwcd dump qestions and answers.recommanded books. Iam Ramesh, i want scwcd dump qestions and answers,recommanded books. Thanking You. RameshReddy T