[wildfly-dev] does Attachments.NEXT_PHASE_DEPS wait for async services or does the next DUP phase start as soon as the service.start returns...

Scott Marlow smarlow at redhat.com
Fri Jun 13 14:52:10 EDT 2014


Hi,

In PersistenceUnitServiceHandler [1], we are creating the persistence 
unit service (PersistenceUnitServiceImpl [2]) and specifying 
Attachments.NEXT_PHASE_DEPS for the service that are creating.

What happens when the service [2] is started asynchronously?  Will the 
next deployment phase start as soon as the async service is started?  Or 
will the next deployment phase as soon as the 
PersistenceUnitServiceImpl.start method returns?  I suspect that it is 
as soon as the async start method returns, which means that the JPA 
ordering is wrong (with respect to allowing the persistence provider to 
rewrite entity classes completely before the POST_MODULE phase starts 
for the deployment.)

This came up with an EclipseLink issue [3] with weaving not working in 
an EAR that contains war (with JSF managed beans) and a jar that has a 
persistence unit/entities.  The managed bean classes (indirectly) 
reference the entity classes, which causes them to be loaded during the 
POST_MODULE phase.  We are reaching the POST_MODULE phase sooner than I 
expected.


Scott


[1] 
https://github.com/wildfly/wildfly/blob/master/jpa/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitServiceHandler.java#L424

[2] 
https://github.com/wildfly/wildfly/blob/master/jpa/src/main/java/org/jboss/as/jpa/service/PersistenceUnitServiceImpl.java#L192

[3] https://community.jboss.org/message/878100#878100


More information about the wildfly-dev mailing list