Hi Deepthi,
A persistence context is somwhat like a logical collection of managed entities in the memory.
When you create an application-managed persistence context, for a given persistence
unit, you are specifying the entitiy types that the persistence context will manage.
Now, when an application managed entity manager is associated with a transaction, it is bound to get in sync with the database when the transaction commits., ie, all the changes made to the entities that had become managed during the scope of the transaction using that entity manager will be saved in the database at transaction commit time. Once the transaction commits, the 'in-memory' entities are not cleared. They will still be tracked down by the entity manager in the case of an application-scoped entity manager. So, if you make changes to the managed entities when there is no transaction surrounding the entity manager, then entity manager will keep track of them.
The next time your app-managed entity manager becomes associated with a transaction, the chages will be reflected in the database when the transaction commits or a flush is done, as implemented by your persistence provider.
This indicates that your persistence context has an 'extended' lifespan, because even in the absence of a transaction, the entity instances remain managed. So the 'standalone' feature refers to the fact that persistence context 'propagation' i.e, using the same persistence context for utility method that you call from you method that creates the entity manager, is not inherently available for a app-managed entity manager but which is available in the case of a container-managed entity manager. The container handles the propagation for you behind the scenes.
In the case of a container-managed entity manager, all the entity that were managed during the transaction become detached the moment the transaction commits. So, changes made outside the transaction will not be reflected. These changes can be updated in your DB only when you try to again make these detached instances managed by the merge method.
Hope this helps
Regards
Ryan Sukale