This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
>> Manged State ---------- Commit()or rollback()--Detached State
rollback will detach everything, however a commit using a JPA transaction will continue the persistence context, so the objects will remain managed unless you call clear.
If using a JTA (EJB) transaction, then commit will detached everything.
>> Detached State---------merge()or find()------ ---Managed State
merge with "return" a managed object, the object being merged will remain detached.
Find will return a managed object.