Affects Version/s: None
Fix Version/s: None
Copied from https://issues.jboss.org/browse/CDI-144
JPA spec 3.5.2 states: "In general, the lifecycle method of a portable application should not invoke EntityManager or Query operations, access other entity instances, or modify relationships within the same persistence context. A lifecycle callback method may modify the non-relationship state of the entity on which it is invoked."
Since I have been running into this issue lately: Shouldn't we add a note somewhere that injected (CDI) resources require special attention regarding JPA compliance? And because of that firing CDI events from JPA entity listeners is particularly dangerous?
In my case I tried to implement global available created/updated/deleted entity events which turned out to be a bad idea if implemented on EntityListener level.