Joined: Tue Oct 14, 2003 2:07 pm Posts: 10 Location: Berkeley, CA
|
Q1: Hibernate documentation specifies during onLoad, one should not load any dependent objects. But how about the others- is it safe to make any type of query during onUpdate/onDelete/onSave? We use to have a problem in 2.0.3 where accessing a persistent list of the Hibernate entity during onUpdate which had not been previously lazy loaded would cause the list to be deleted. It appears to be fixed in 2.1
Q2: To implement our audit interceptor, we do the following during the Interceptor callbacks(onFlushDirty,onSave,onDelete)
1. Unbind and save the current Hibernate session from thread via the Spring TransactionSynchronizationManager
2. Create a new Hibernate session for looking through the object to be changed. (We create a new session due to unexpected manglings as mentioned in #1.) Do our stuff and close this session.
3. Restore the original Hibernate session
Should we not be doing this? It works on jboss but bombs on Websphere.
Any enlightening responses will be truly appreciated.
|
|