entities are detached from entitymanager at end of transaction with a transaction scoped entity manager. If it is an extended entity manager, then the entity remains managed. EntityManager.clear() also detaches all managed entities, but you lose an unflushed changes.
Just a few additions:
- on a EXTENDED PC, the PC is destroyed when all SFSB involving with this PC are destroyed.
- if the transaction is rollbacked, the PC is cleared