From the JPA spec [3.3 Persistence Context Lifetime]
Quote:
An EntityManager with an extended persistence context maintains its references to the entity objects
after a transaction has committed. Those objects remain managed by the EntityManager, and they may
be updated as managed objects between transactions.
So you should be seeing true, true if you're really using application-managed entity manager.
As for your question about when entity becomes detached, JPA spec [3.2.4 Detached Entities]
Quote:
A detached entity may result from transaction commit if a transaction-scoped container-managed entity
manager is used (see section 3.3); from transaction rollback (see section 3.3.2); from clearing the persistence
context; from closing an entity manager; and from serializing an entity or otherwise passing an
entity by value—e.g., to a separate application tier, through a remote interface, etc.
The most common cases are after EntityManager.clear() or EntityManager.close().