-->
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.  [ 5 posts ] 
Author Message
 Post subject: Sometimes query returns only one record
PostPosted: Tue Mar 15, 2011 2:48 pm 
Newbie

Joined: Tue Mar 15, 2011 2:38 pm
Posts: 2
Hi, All,

Almost always returns ok, but sometimes the same query returns only one record.
Somebody can help me?

Thanks,
Alexandre Pinheiro


Top
 Profile  
 
 Post subject: Re: Sometimes query returns only one record
PostPosted: Tue Mar 15, 2011 5:06 pm 
Newbie

Joined: Sat Dec 26, 2009 12:58 pm
Posts: 2
a.pinheiro.s wrote:
Almost always returns ok, but sometimes the same query returns only one record.
Somebody can help me?


Could you extend your problem? Does it return different results at the same state of database?


Top
 Profile  
 
 Post subject: Re: Sometimes query returns only one record
PostPosted: Tue Mar 15, 2011 7:31 pm 
Newbie

Joined: Wed Aug 12, 2009 12:34 pm
Posts: 2
The query (HQL/Criteria), which surely should return more than one record, is returning only the first. Note that it is being inserted into LIMIT clause in some queries.

The problem occurs more frequently in production, hardly able to simulate in the laboratory.

We use Hibernate 3.2.6 and postgres 8.3.


Top
 Profile  
 
 Post subject: Re: Sometimes query returns only one record
PostPosted: Wed Mar 16, 2011 7:34 am 
Newbie

Joined: Tue Mar 15, 2011 2:38 pm
Posts: 2
pjw wrote:
a.pinheiro.s wrote:
Almost always returns ok, but sometimes the same query returns only one record.
Somebody can help me?


Could you extend your problem? Does it return different results at the same state of database?



Exactly, different results at the same state of database. Sometimes returns ok (list with many records), sometimes returns only one record (rarely).
Will be a problem in this version of hibernate (Please, see Geissivan's post)?


Top
 Profile  
 
 Post subject: Re: Sometimes query returns only one record
PostPosted: Thu Mar 17, 2011 5:00 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
have you enabled second level cache, especially query cache?

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.