Closed Farley-Chen closed 5 months ago
JPAs behaviour is undefined when accessing the EntityManager
in life cycle methods:
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.
The behaviour depends on the underlying JPA implementation not on Spring Data.
When there is more then one row in the table.
If you remove one entity, and then search in the entity listener in
@PostRemove
method if will fail on StaleObjectStateException.The code sample is here.
issue.zip