-->
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: Extra-lazy collections and extended Hibernate sessions
PostPosted: Mon Apr 06, 2009 11:11 pm 
Newbie

Joined: Mon Apr 06, 2009 10:48 pm
Posts: 4
Location: Wellington, New Zealand
I'm using the 'Extending a Session for a conversation' model (section 11.2.3 of the Hibernate book), implemented using Spring Web Flow flow-managed persistence.

The Spring implementation of this uses sessions with FlushMode.MANUAL, and performs all changes accumulated in the Persistence Context in a single transaction, at the end of the conversation.

I'm thinking about using an extra-lazy collection, but looking at AbstractPersistentCollection.readSize(), for extra-lazy collections Session.flush() is run regardless of the flush mode.

This then seems to break the 'extended conversation' model, making me think that I can't use extra-lazy collections.

I understand the motivation for flushing the session prior to querying the DB, but in other places where queries are to be performed, the configured FlushMode is respected.

So:
  • Am I interpreting this correctly, and is my concern valid?
  • Could this call to Session.flush() irrespective of the configured FlushMode be considered a bug?


Thanks!
Aron


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.