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.  [ 2 posts ] 
Author Message
 Post subject: Use of the session within IInterceptor callbacks
PostPosted: Wed Sep 19, 2007 11:05 pm 
Beginner
Beginner

Joined: Thu Nov 02, 2006 5:11 pm
Posts: 32
Location: Toronto
Is there any documentation on what (if any) ISession methods can legally be invoked from within the IInterceptor callbacks? For example, can I execute a query from within PreFlush or OnFlushDirty? Can I access a lazy proxy or collection on an entity that is being flushed?

It would seem that doing these kinds of things from within the interceptor would mess up the session. Is this known to be a problem in practice?

Also, is there a best practice as for how to abort a flush from the interceptor? For example, throwing an exception from PreFlush?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 22, 2007 3:42 pm 
Beginner
Beginner

Joined: Thu Nov 02, 2006 5:11 pm
Posts: 32
Location: Toronto
Looks like the answer to the first question was in the source code comments:

/// The <c>ISession</c> may not be invoked from a callback (nor may a callback cause a collection or
/// proxy to be lazily initialized).


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

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.