HHH-8076 defines the best case option for handling the chicken/egg problem between CDI and JPA using a specific notification event (as a BeanManager lifecycle event) that the BeanManager is ready for use. However, it is also possible to define a setting that allows telling Hibernate to delay access to the CDI BeanManager until it is needed on first use. There is some danger in this solution as it moves the throwing of potential exceptions that should fail the deployment until runtime after deployment has succeeded. |