-->
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: Design issue/flaw
PostPosted: Thu Nov 20, 2008 2:49 am 
Newbie

Joined: Fri Feb 17, 2006 6:02 am
Posts: 6
I was wondering if this design point/flaw is still valid:

QueryLoader
http://kickjava.com/src/org/hibernate/l ... r.java.htm
Makes Iterator:
http://kickjava.com/src/org/hibernate/i ... l.java.htm

QueryLoader gives ResultSet and PreparedStatement to iterator.


Every time Qeury.iterator() is called, it executes queries. So, if you do not iterate code to the end it leaves PS, RS open. close()-method is only called if hasNext() is false. (postNext())

Commit does not close these since it does not have access to them (?).

This code leaves preparedstatement open and finally after 100-200 open preparedstatements hibernate crashes:
Code:
if(query.iterate().hasNext()) query.iterate().next();


I think this is a major design issue. Is this considered as bug or "it works like this, just iterate to the end and use proper SQL-queries"?

We have hibernate version 3.1.2


Top
 Profile  
 
 Post subject: Re: Design issue/flaw
PostPosted: Mon Nov 24, 2008 2:06 am 
Newbie

Joined: Fri Feb 17, 2006 6:02 am
Posts: 6
http://opensource.atlassian.com/project ... e/HHH-3619


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.