|
Such "timing" issues between components is unfortunately left up to containers in the EE spec. That is, the EE spec does not specify any bootstrap ordering between its various components. Red Hat brought this to the attention of the EE and JPA EGs, but to no avail.
So there are some ways around that. Unfortunately they are all vendor specific. For example, amongst components used in WildFly we develop a number "proprietary bootstrap SPIs". So WildFly, for example, does not bootstrap Hibernate in the normal EE/JPA defined manner for "managed EMFs". Instead WildFly uses a proprietary 2-phase EMF bootstrap I developed in Hibernate to alleviate some of these timing issues.
All that may or may not help you. Just wanted to point out that yes it is a pita.
|