-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Limitations on the lifecycle callbacks
PostPosted: Mon Feb 23, 2004 10:28 pm 
Newbie

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.