About Question enthuware.oce-jpad.v6.2.352 :
Posted: Fri Jan 22, 2016 9:41 am
Is the merge operation really needed here?
The fact that EntityTransaction is used, implies the use of a resource-local entity manager.
A resource-local entity manager is always application-managed (because non-JTA transactions cannot be container-managed).
Furthermore, an application-managed entity manager always manages an extended persistence context.
That means that the lcte object is still managed by the entity manager after the first commit and the merge operation can be omitted (but it wouldn't hurt to leave it in).
Is this information worth adding to the explanation?
The fact that EntityTransaction is used, implies the use of a resource-local entity manager.
A resource-local entity manager is always application-managed (because non-JTA transactions cannot be container-managed).
Furthermore, an application-managed entity manager always manages an extended persistence context.
That means that the lcte object is still managed by the entity manager after the first commit and the merge operation can be omitted (but it wouldn't hurt to leave it in).
Is this information worth adding to the explanation?