-->
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: Problem with "Restrictions.in"
PostPosted: Fri May 14, 2010 7:02 am 
Newbie

Joined: Fri May 14, 2010 6:43 am
Posts: 1
Hi, I am having a strange case that I want to expose, if you can give me some clue about what is happening.
The following code stops working properly (it returns no record) when run a number of times:

Criteria fonCriteria = this.getSession().createCriteria(igfFondo.class);

String[] fondosPermitidos = new String[300];

for (int i=0; i<300;i++)
{
fondosPermitidos[0]= "A01";
}

fonCriteria.add(Restrictions.in("fondo", fondosPermitidos));

List fondos=fonCriteria.list();


I know this code does not make much sense, it is a test code that I created to reproduce the error.

The problem is that the query only gives the expected results a number of times, which is always the same number of times if we pass the same number of parameters to "Restrictions.in."

The weirdest thing is that the problem only occurs in the following environments:

Application Server: JBoss 4.0.5 on Linux Ubuntu Server 9.10 (Java Version: 1.6.0_15-b03)
DB: DB2 en AS400

It works correctly in the following environments:

Application Server: JBoss 4.0.5 on Linux Ubuntu Server 9.10 (Java Version: 1.6.0_15-b03)
DB: MySQL on Linux Ubuntu Server 9.10 (misma maquina que JBoss)

Application Server: JBoss 4.0.5 on Windows XP
DB: MySQL on Linux Ubuntu Server 9.10, or DB2 on AS400


The query generated by Hibernate (version 3.1.3) is the same when it works good and evil, and is as follows:

select this_.FONDO as FONDO3_0_, this_.IGFDNBR as IGFDNBR3_0_, this_.IGFDTIP as IGFDTIP3_0_, this_.IGFDNIF as IGFDNIF3_0_, this_.IGFDRBE as IGFDRBE3_0_, this_.IGFDRCN as IGFDRCN3_0_, this_.IGFDDEP as IGFDDEP3_0_, this_.IGFDFCO as IGFDFCO3_0_, this_.IGFDFBA as IGFDFBA3_0_, this_.IGFDFCN as IGFDFCN3_0_, this_.IGFDNIG as IGFDNIG3_0_, this_.IGFDRGE as IGFDRGE3_0_, this_.IGFDFRM as IGFDFRM3_0_, this_.IGFDNIN as IGFDNIN3_0_, this_.IGFDLI1 as IGFDLI15_3_0_, this_.IGFDTIT as IGFDTIT3_0_, this_.IGFDVLI as IGFDVLI3_0_, this_.IGFDNDI as IGFDNDI3_0_, this_.IGFDNPA as IGFDNPA3_0_, this_.IGFDTOM as IGFDTOM3_0_, this_.IGFDSGE as IGFDSGE3_0_, this_.IGFDSEC as IGFDSEC3_0_, this_.IGFDLIB as IGFDLIB3_0_, this_.IGFDFOL as IGFDFOL3_0_, this_.IGFDHOJ as IGFDHOJ3_0_, this_.IGFDFIG as IGFDFIG3_0_, this_.IGFDFFG as IGFDFFG3_0_, this_.IGFDVGA as IGFDVGA3_0_, this_.IGFDFGA as IGFDFGA3_0_, this_.IGFDCA2 as IGFDCA30_3_0_, this_.IGFDCA3 as IGFDCA31_3_0_, this_.IGFDDIV as IGFDDIV3_0_, this_.IGFDREF as IGFDREF3_0_, this_.IGFDM22 as IGFDM34_3_0_, this_.IGFDISI as IGFDISI3_0_, this_.IGFDPRO as IGFDPRO3_0_, this_.IGFDOM as IGFDOM3_0_, this_.IGFPOB as IGFPOB3_0_, this_.IGFCOP as IGFCOP3_0_, this_.IGFCCV as IGFCCV3_0_, this_.IGFCCC as IGFCCC3_0_, this_.IGFGGES as IGFGGES3_0_, this_.IGFAUD as IGFAUD3_0_, this_.IGFNOM as IGFNOM3_0_, this_.IGFMAI as IGFMAI3_0_, this_.IGFGEST as IGFGEST3_0_, this_.IGFMGE as IGFMGE3_0_, this_.IGFTEL as IGFTEL3_0_, this_.IGFFIA as IGFFIA3_0_, this_.IGFBEN as IGFBEN3_0_, this_.IGFTIG as IGFTIG3_0_, this_.IGFPOI as IGFPOI3_0_, this_.IGFDELEG as IGFDELEG3_0_, this_.IGFOFIC as IGFOFIC3_0_, this_.IGFBOLSA as IGFBOLSA3_0_ from IGDATTEST.IGFFONDO this_ where this_.FONDO in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?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?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and this_.IGFDTIP in (?, ?, ?, ?) and this_.IGFDNIG=? order by this_.FONDO asc

What is happening?


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.