>> 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.