Member Since Oct-2008 |
Answered On : Oct 19th, 2008
Use update() if you are sure that the session does not contain an already persistent instance with the same identifier, and merge() if you want to merge your modifications at any time without consideration of the state of the session. In other words, update() is usually the first method you would call in a fresh session, ensuring that reattachment of your detached instances is the first operation that is executed.
Answered by: amit on: Jan 29th, 2013
suppose you have detached object (means after closing session persistence object becomes detached object) and you have done some changes in this object with help of setter method now you created new ...
Answered by: Rajani on: Oct 20th, 2011
In Hibernate session can maintain only one object in persistent state with same id number. while converting a detached object into persistent,if already that session has a persistent object with the s...
Editorial / Best Answer
Answered by: promisingram
View all answers by promisingram
Member Since Oct-2008 | Answered On : Oct 19th, 2008
Use update() if you are sure that the session does not contain an already persistent instance with the same identifier, and merge() if you want to merge your modifications at any time without consideration of the state of the session. In other words, update() is usually the first method you would call in a fresh session, ensuring that reattachment of your detached instances is the first operation that is executed.
suppose you have detached object (means after closing session persistence object becomes detached object) and you have done some changes in this object with help of setter method now you created new ...
In Hibernate session can maintain only one object in persistent state with same id number. while converting a detached object into persistent,if already that session has a persistent object with the s...