-->
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: ScrollableResults with many transactions
PostPosted: Thu Nov 09, 2006 9:51 am 
Newbie

Joined: Wed Aug 25, 2004 11:47 am
Posts: 3
I need to do something lik that:

1. Start ScrollableResults (FORWARD_ONLY)
2. Start loop through results
3. Start transaction
4. Do some work with entity
5. Commit transaction
6. End loop
7. Close ScrollableResults

The problem, is that I'm getting error "Cannot operate on closed ResultSet".
Batch update is not suitable for me, because of our architecture (one of the reasons is that we don't want to lock the objects in database for the lenghty process) and actually it's not a batch update, but data maintenance task.

There was a discussion already about that. It seems, that c3p0 gives this error. But there's no solution for that.

This problem affects 3.2.0 GA version. In 3.1.x version there weren't this kind of problems.

Maybe there is other way to iterate through objects whithout fetchin all them in memory?. Query.iterate() also gives the same error.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 30, 2007 11:26 am 
Newbie

Joined: Tue Mar 15, 2005 1:38 pm
Posts: 11
I'm doing exactly the same thing and am experiencing the same problem with Hibernate v3.1.3. Did you ever find a good solution to your problem? So far the only solution I've found is to set the following property:

Code:
hibernate.connection.release_mode on_close


but this doesn't seem like the best solution to me as it's a global setting and is not really recommended according to the manual. It seems to me this is actually a bug in Hibernate. Shouldn't Hibernate do a check for open resultsets/cursors instead of blindly releasing the connection at the end of a transaction?

Thanks,
Corey


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.