-->
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.  [ 4 posts ] 
Author Message
 Post subject: Not returning all results from db though generated sql does!
PostPosted: Thu Jul 27, 2006 4:27 am 
Newbie

Joined: Fri Nov 04, 2005 5:40 pm
Posts: 16
Hey, im not sure whats going on here, but i hope you can help me find out.
I am executing a simple HQL, which looks like this:

Code:
10:22:20,843 DEBUG [QueryTranslatorImpl] parse() - HQL: from de.gameservice.library.Kontofuehrung u where u.users.username = :username and u.timestamp>=:start and u.timestamp<=:ende order by u.timestamp desc


The parameters are also set correctly:

Code:
10:22:20,843 DEBUG [QueryLoader] bindNamedParameters() Sat Jul 01 04:00:00 CEST 2006 -> start [2]
10:22:20,859 DEBUG [TimestampType] binding '2006-07-01 04:00:00' to parameter: 2
10:22:20,859 DEBUG [QueryLoader] bindNamedParameters() Tue Aug 01 03:59:59 CEST 2006 -> ende [3]
10:22:20,859 DEBUG [TimestampType] binding '2006-08-01 03:59:59' to parameter: 3
10:22:20,859 DEBUG [QueryLoader] bindNamedParameters() cagara -> username [1]
10:22:20,859 DEBUG [StringType] binding 'cagara' to parameter: 1



and last but not least, the SQL statement is also generated correctly. When executing the generated SQL statement in phpMyAdmin it correctly returns all 4 elements:

Image

But Hibernate returns only 3 elements, only the ones from July, not the one from August. There is one element missing. WHY THE HECK???


Code:
10:22:20,859 DEBUG [Loader] done processing result set (3 rows)
10:22:20,859 DEBUG [AbstractBatcher] about to close ResultSet (open ResultSets: 1, globally: 1)
10:22:20,859 DEBUG [AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10:22:20,859 DEBUG [AbstractBatcher] closing statement




Actually....why do i get only 3 elements returned. Is that probably a BUG in Hibernate? It must be because there is no other explanation for this misterious problem!



I hope you can help me....


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 4:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
probably a timezone issue; not hibernate specific.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 4:52 am 
Newbie

Joined: Fri Nov 04, 2005 5:40 pm
Posts: 16
im probably the dumbest person on the planet...
after 48 hours of trying to figure out where the problem is, i finally got it,
its a "setMaxResults(3)"!

Im sorry for my stupidity!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 4:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
...that would have been my second suggestion ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.