The Hibernate interfaces that you implement to provide event listeners, for example: org.hibernate.event.PostInsertEventListener;all extend Serializable.
However, nothing explains why your listeners should be serializable. We introduced a DAO with a database connection for some time, and it hasn’t worked yet, however I’m worried that there may be a case where Hibernate will transfer the listener via a serialized link and therefore lose the database connection.
So the question is: why should sleep mode listeners be serializable?
source
share