views:

41

answers:

1

What is the benefit of detached object? What value do they provide? Thanks.

+4  A: 

When you need to keep a object "alive" between distinct hibernate sessions. Example: in web applications, if you're using the session-per-request pattern, and you need to keep the same hibernate entity between many pages.

Please take a look at the Hibernate docs:

Chapter 10: Working with objects

Chapter 11: Transactions and Concurrency

rsenna