-->
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: select returns incorrect results
PostPosted: Tue Oct 02, 2007 1:55 pm 
Newbie

Joined: Tue Oct 02, 2007 1:11 pm
Posts: 1
Hi,
Time to time I get wrong select results.
Simple query:
select f from EntityName where upper(f.columnName) like :paramOne

if paramOne = "test1" query should return ONE object
if paramOne = "test2" query should return TWO object

if entity (EntityName) was not used for some time and
if I first execute query with paramOne = "test1" hibernate returns ONE object and thats is ok, but if I after that execute query with paramOne = "test2" hibernate returns only ONE object, but it should return TWO objects.

It happens not always it is difficult to know when it will happen next time.

When it happens all next queries with different paramOne values returns one object ignoring different paramOne values (which normally should return more than one objects). And this continues till you leave entity for some time not used. Or if change query (for example add additional parameter) it returns correct result.



Real queries from app (I execute additionally select with count(*)) :

First queries
select count(*) from RiksUser f WHERE upper(f.bo.riksUserName) like :riksUserName
riksUserName = %TEST1%
Returns 1 - thats ok

select f from RiksUser f WHERE upper(f.bo.riksUserName) like :riksUserName
riksUserName = %TEST1%
Returns 1 object - thats ok


Second queries
select count(*) from RiksUser f WHERE upper(f.bo.riksUserName) like :riksUserName
riksUserName = %TEST2%
Returns 2 - thats ok

select f from RiksUser f WHERE upper(f.bo.riksUserName) like :riksUserName
riksUserName = %TEST2%
Returns 1 object - thats ERROR


All those queries I execute on jboss-4.2.0.GA (EJB3), but as I know jboss use hibernate engine, so perhaps this error is hibernate problem.


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.