Details
Description
This is about EAR deployments that contain multiple sub-deployments. Currently, EJB jar sub-deployments may still be starting their JPA persistence units while other sub-deployments move ahead (in parallel) to other deployment phases (which can cause the entity classes to be loaded before the persistence provider has been registered with the class file transformer for the persistence unit).
Each deployment/sub-deployment should set the NEXT_PHASE_DEP on the persistence unit service (see current phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, puServiceName) in PersistenceUnitServiceHandler). For this to work, each deployment/subdeployment should set NEXT_PHASE_DEPS during the FIRST_MODULE_USE phase for each pre-determine persistence unit service name).