I have a @PostPersist EntityListener which I expected to be called after the transaction is finished and the data is in the database, however this doesn't seem to be the case. The EntityListener is called before the transaction ends when the data is not yet in the database, meaning a rollback can occur after the EntityListener has been called. Is this the expected behaviour of PostPersist? if so it's rather confusing and I don't see how in practice it's different from @PrePersist?
These threads touch on the issue also, but neither recieved an answer.