That may have to do with the unsaved value for the persistence id of your object. The ejb 3 spec does not specify explicitly how a persistence manager differentiates a new/transient entity from a dettached one (may be provider specific), but hibernate does.
Look at the unsaved-value attribute of the id element:
http://www.hibernate.org/hib_docs/v3/reference/en/html/mapping.html#mapping-declaration-id
Indeed, entity managers are supposed to throw an exception when attempting to persist a dettached entity
Quote:
"If X is a detached object, the EntityExistsException may be thrown when the persist operation is invoked, or the EntityExistsException or another PersistenceException may be thrown at flush or commit time."
So, when not setting the Id to 0, what is the value of this property right before persisting the entity through the second entity manager? Is it 1? null?
Hope this helps a little,
Regards,