[jboss-user] [EJB 3.0] - select returns incorrect results

snau2005 do-not-reply at jboss.com
Wed Oct 3 02:59:33 EDT 2007


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" jboss returns ONE object and thats is ok, but if I after that execute query with paramOne = "test2" jboss 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).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090899#4090899

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090899



More information about the jboss-user mailing list