We have a need to capture some additonal information about some of the changed entities during "beforeTransactionCommit, postFlush, onLoad, onDelete, onSave, onFlushDirty". This require us to use the Hibernate session to do queries, and also in the beforeTransactionCommit callback to write data to the database. From what we understand this is not recommended.
So the question is, Is there a safe way to use hibernate session from any of the the above callback points?
If there a better options to capture additional information other than using the above callbacks, please let me know.
Thanks in advance.
Regards, Vinoo
|