Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 75253 invoked from network); 25 Nov 2008 08:28:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Nov 2008 08:28:50 -0000 Received: (qmail 63507 invoked by uid 500); 25 Nov 2008 08:28:54 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 63491 invoked by uid 500); 25 Nov 2008 08:28:54 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 63480 invoked by uid 99); 25 Nov 2008 08:28:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Nov 2008 00:28:54 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tricae@gmail.com designates 209.85.217.16 as permitted sender) Received: from [209.85.217.16] (HELO mail-gx0-f16.google.com) (209.85.217.16) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Nov 2008 08:27:29 +0000 Received: by gxk9 with SMTP id 9so2472591gxk.0 for ; Tue, 25 Nov 2008 00:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=XSiUvDdRKI9Qh+2B5yjPElZq6I2oZDCvpHd2Um93D9k=; b=hwNS/wxpCJJ2N0NztCeZHl6e+niogyiCC++tEZMdh/KvVJPsmz/fMGyrWRw1soEz2A vxNKzRqlgmDD/QXUy6+4roHicDXNWuqPsP8CdHIWhQ/GGT0gsL0n/Yazq4+pl50YlKoH qsl2dM9xjs6cfshYRU/GJR+Z9kMqvhmPDVDHk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=F1kuXAgNVq4nibI/oN8sRw9TRH3Jn1bGE6z+oGRAI/RgeQY3L0reYhEojM6nPiGArR GJCTTfmEjesGShInB7Tfg5uP89dr0kfYlfwZ1QkxUHM+29dHfc9QkfpEtP7y6Bbvou5U 8DyHA3vYQVV/VksQRmjVBMo6W4N35t8mguoJc= Received: by 10.64.21.10 with SMTP id 10mr4485088qbu.48.1227601693204; Tue, 25 Nov 2008 00:28:13 -0800 (PST) Received: by 10.65.22.10 with HTTP; Tue, 25 Nov 2008 00:28:13 -0800 (PST) Message-ID: <7c31ed2d0811250028p151dbf6n58c43b54ce441759@mail.gmail.com> Date: Tue, 25 Nov 2008 09:28:13 +0100 From: "=?ISO-8859-1?Q?Corn=E9_A?=" To: user-java@ibatis.apache.org Subject: Re: Strange problems and wrong data on Linux (redhat) not on Windows In-Reply-To: <7c31ed2d0811241440g934b3e5m3741a55ef5636dac@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2489_27870453.1227601693237" References: <7c31ed2d0811241440g934b3e5m3741a55ef5636dac@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_2489_27870453.1227601693237 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline For what its worth; I also tested it against the ibatis-2.3.4.726.jar build and all problems occur the same. 2008/11/24 Corn=E9 A > Hi all, > I am a happy ibatis user for years and now I have encountered a strange > thing. > > I have Ibatis build with jdk 1.5.0_16 on my Windows XP. > When updating with any of the 4 abator generated stubs on either jdk 1.5 = or > 1.6 I encounter *no* problems on a windows XP box. > When I deploy everthing to a Linux box I get the weirdest errors from the > Driver. > > abatorgenerated_updateByExampleSelective & abatorgenerated_updateByExampl= e > both give; > com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred while applying a parameter map. > --- Check the > vdprre.abatorgenerated_updateByExampleSelective-InlineParameterMap. > --- Check the statement (update failed). > --- Cause: java.sql.SQLException: [unixODBC][INTERCHAIN][UNIMS-ODBC] > [UNIMS] > Invoeren of wijzigen: Duplikaat in index! > *insert or update : duplicate in index * > updateByPrimaryKeySelective & updateByPrimaryKey inputs the wrong data; > {conn-100231} Preparing Statement: update vdprre > set vdperc =3D ? , vdmuwe =3D > ? where relnr =3D ? and artgrf =3D ? and vdwe= ek =3D > ? and vdsort =3D ? > {pstm-100232} Executing Statement: update vdprre > set vdperc =3D ? , vdmuwe =3D > ? where relnr =3D ? and artgrf =3D ? and vdwe= ek =3D > ? and vdsort =3D ? > {pstm-100232} Parameters: [11, 200847, 131505, 310, 200852, PGE55] > {pstm-100232} Types: [java.lang.Short, java.lang.Integer, > java.lang.Integer, java.lang.Short, java.lang.Integer, java.lang.String] > Returned connection 15529415 to pool. > > While I try to update vdperc =3D 12 ,vdmuwe =3D *20*0844 the data becomes= ; > > relnr artgrf vdweek vdsort vdperc vdmuwe > 131505 310 200852 PGE55 *null* *20* > 131505 310 200852 PGE65 *null* *20* > Note: there is some difference in the XP logging (spacing)? > {conn-100021} Preparing Statement: update vdprre set > vdperc=3D?,vdmuwe=3D? where relnr =3D ? and artgrf =3D ? and vdweek= =3D ? and > vdsort =3D ? > {pstm-100022} Executing Statement: update vdprre set > vdperc=3D?,vdmuwe=3D? where relnr =3D ? and artgrf =3D ? and vdweek = =3D ? and > vdsort =3D ? > {pstm-100022} Parameters: [11, 200847, 131505, 310, 200852, PGE55] > {pstm-100022} Types: [java.lang.Short, java.lang.Integer, > java.lang.Integer, java.lang.Short, java.lang.Integer, java.lang.String] > > parameterClass=3D"nl.pfm.vdn.ds.vdn.model.AanvoerVerwachtingRegel"> > update vdprre > > > vdperc =3D #percentage:NUMERIC# > > > vdmuwe =3D #mutatieWeek:NUMERIC# > > > where relnr =3D #relatieNummer:NUMERIC# > and artgrf =3D #groepFinancieel:NUMERIC# > and vdweek =3D #weekNummer:NUMERIC# > and vdsort =3D #sortering:VARCHAR# > > > Where as hardcoded values will be updated correctly > > parameterClass=3D"nl.pfm.vdn.ds.vdn.model.AanvoerVerwachtingRegel"> > update vdprre > set vdperc =3D 12 ,vdmuwe =3D 200844 > here relnr =3D #relatieNummer:NUMERIC# > and artgrf =3D #groepFinancieel:NUMERIC# > and vdweek =3D #weekNummer:NUMERIC# > and vdsort =3D #sortering:VARCHAR# > > > Swapping the set columns doesn't change this behaviour set vdmuwe =3D 200= 844, > vdperc =3D 12. > Could this have something to do with a xmlparser ? > Can anyone help me putting me on the right track or give me ways to get > closer to the solution. > Because i am desperately stuck at the moment. > > I even found more erroneus data (null & chopped) but kept it for brevity. > > Thanks and if someone needs more input just let me know, > > Corne > > *Below my testing code; > * Integer telerNummer =3D new Integer(131505); > Short productNummer =3D new Short("310"); > Integer weekNummer =3D new Integer(200852); > String sorteringNaam =3D "PGE55"; > Integer mutatieDatum =3D new Integer(200847); > Short percentage =3D new Short("11"); > > Connection conn =3D java.sql.DriverManager.*getConnection*(driverURL, > user, password); > PreparedStatement ps =3D conn.prepareStatement(sql); > ps.setShort(1, percentage); > ps.setInt( 2, mutatieDatum); > ps.setInt(3, telerNummer); > ps.setShort(4, productNummer); > ps.setInt(5, weekNummer); > ps.setString(6, sorteringNaam); > int retval =3D ps.executeUpdate(); > System.out.println("UPDATED RECORDS:" + retval); > > AanvoerVerwachtingRegel record =3D new AanvoerVerwachtingRegel(); > record.setRelatieNummer(telerNummer); > record.setWeekNummer(weekNummer); > record.setGroepFinancieel(productNummer); > record.setSortering(sorteringNaam); > record.setMutatieWeek(mutatieDatum); > record.setPercentage(percentage); > > SqlMapClient vdn_SqlMapClient =3D VDN_SqlMapClient.getSqlMapInstance()= ; > AanvoerVerwachtingRegelDAO aanvoerVerwachtingRegelDAO =3D new > AanvoerVerwachtingRegelDAOImpl(vdn_SqlMapClient); > try { > int result1 =3D > aanvoerVerwachtingRegelDAO.updateByPrimaryKeySelective(record); > System.out.println("UPDATED RECORDS updateByPrimaryKeySelective:" + > result1); > } catch (Exception e) { > e.printStackTrace(); > } > > try { > record.setSortering("PGE65"); > int result2 =3D aanvoerVerwachtingRegelDAO.updateByPrimaryKey(record)= ; > System.out.println("UPDATED RECORDS updateByPrimaryKey:" + result2); > } catch (Exception e) { > e.printStackTrace(); > } > AanvoerVerwachtingRegelExample example =3D new > AanvoerVerwachtingRegelExample(); > AanvoerVerwachtingRegelExample.Criteria criteria =3D > example.createCriteria(); > criteria =3D criteria.andRelatieNummerEqualTo(telerNummer); > criteria =3D criteria.andGroepFinancieelEqualTo(productNummer); > criteria =3D criteria.andWeekNummerEqualTo(weekNummer); > criteria =3D criteria.andSorteringEqualTo(sorteringNaam); > > try { > int result3 =3D aanvoerVerwachtingRegelDAO.updateByExample(record, > example); > System.out.println("UPDATED RECORDS updateByExample:" + result3); > } catch (Exception e) { > e.printStackTrace(); > } > > try { > int result4 =3D > aanvoerVerwachtingRegelDAO.updateByExampleSelective(record, example); > System.out.println("UPDATED RECORDS updateByExampleSelective:" + > result4); > } catch (Exception e) { > e.printStackTrace(); > } > ------=_Part_2489_27870453.1227601693237 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
For what its worth;
I also tested it against the ibatis-2.3.4.726.jar build and all proble= ms occur the same.

 
2008/11/24 Corn=E9 A <tricae@gmail.com>
Hi all,
I am a happy ibatis user for years and now I have encountere= d a strange thing.
 
I have Ibatis build with jdk 1.5.0_16 on my Windows XP.
When updating with any of the 4 abator generated stubs on either jdk 1= .5 or 1.6 I encounter no problems on a windows XP box= .
When I deploy everthing to a Linux box I get the weirdest er= rors from the Driver.

abatorgenerated_updateByExampleSelective &= amp; abatorgenerated_updateByExample both= give;
com.ibatis.common.jdbc.exception.NestedSQLException:<= br>--- The error occurred while applying a parameter map.
--- Check the = vdprre.abatorgenerated_updateByExampleSelective-InlineParameterMap.
--- = Check the statement (update failed).
--- Cause: java.sql.SQLException: [unixODBC][INTERCHAIN][UNIMS-ODBC] [UNIMS= ]
Invoeren of wijzigen:  Duplikaat in index!

insert or update := duplicate in index
=  
updateByPrimaryKeySelective & updateByPrimaryKey inputs the wrong&= nbsp;data;
{conn-100231} Preparing Statement:&= nbsp;          update vdprre&n= bsp;    set        &= nbsp;       vdperc =3D ?   &nb= sp;          ,  &nbs= p;      vdmuwe =3D ?     =             where re= lnr =3D ?       and artgrf =3D ?  &= nbsp;    and vdweek =3D ?      = ; and vdsort =3D ?  
{pstm-100232} Executing Statement:       = ;    update vdprre     set  &n= bsp;            = ; vdperc =3D ?          &= nbsp;   ,         vdmuwe = =3D ?           &nbs= p;     where relnr =3D ?     &= nbsp; and artgrf =3D ?       and vdweek =3D ?=        and vdsort =3D ?  
{pstm-100232} Parameters: [11, 200847, 131505, 310, 200852, PGE55]
{pstm= -100232} Types: [java.lang.Short, java.lang.Integer, java.lang.Integer, jav= a.lang.Short, java.lang.Integer, java.lang.String]
Returned connection 1= 5529415 to pool.
 
While I try to update vdperc =3D 12 ,vdmuwe =3D 200844 the data becomes;

relnr     artgrf vdweek vdsort &n= bsp; vdperc vdmuwe 
131505 = ;310   200852 PGE55 null    20 
131505 310   200852 PGE65 null    20 
Note: there is some difference in the XP logging (spacing)?
{conn-100021} Preparing Statement:&= nbsp;          update vdprre s= et vdperc=3D?,vdmuwe=3D?     where relnr =3D ?  an= d artgrf =3D ?  and vdweek =3D ? and vdsort =3D ?  
{pst= m-100022} Executing Statement:       &nb= sp;   update vdprre set vdperc=3D?,vdmuwe=3D?    w= here relnr =3D ?  and artgrf =3D ?  and vdweek =3D ? and vdsort = =3D ?  
{pstm-100022} Parameters: [11, 200847, 131505, 310, 200852, PGE55]
{pstm= -100022} Types: [java.lang.Short, java.lang.Integer, java.lang.Integer, jav= a.lang.Short, java.lang.Integer, java.lang.String]

 
<update id=3D"abatorgenerat= ed_updateByPrimaryKeySelective" parameterClass=3D"nl.pfm.vdn.ds.v= dn.model.AanvoerVerwachtingRegel">
    update vdp= rre
    <dynamic prepend=3D"set">
      <isNotNull prepend=3D"," proper= ty=3D"percentage">
      &nbs= p; vdperc =3D #percentage:NUMERIC#
      </i= sNotNull>
      <isNotNull prepend=3D&quo= t;," property=3D"mutatieWeek">
        vdmuwe =3D #mutatieWeek:NUMERIC#=
      </isNotNull>
   = </dynamic>
    where relnr =3D #relatieNummer:NUME= RIC#
      and artgrf =3D #groepFinancieel:NUME= RIC#
      and vdweek =3D #weekNummer:NUMERIC#<= br>       and vdsort =3D #sortering:VARCHAR#
</u= pdate>
 
Where as hardcoded values will be updated correctly
 
<update id=3D"abatorgenerat= ed_updateByPrimaryKeySelective" parameterClass=3D"nl.pfm.vdn.ds.v= dn.model.AanvoerVerwachtingRegel">
update vdprre
set vdperc= =3D 12 ,vdmuwe =3D 200844
here relnr =3D #relatieNummer:NUMERIC#
and= artgrf =3D #groepFinancieel:NUMERIC#
and vdweek =3D #weekNummer:NUMERIC= #
and vdsort =3D #sortering:VARCHAR#
</update>
 
Swapping the set columns doesn't change this behaviour set vdmuwe = =3D 200844, vdperc =3D 12.
Could this have something to do with a xmlparser ?
Can anyone help&= nbsp;me putting me on the right track or give me ways to get closer to the = solution.
Because i am desperately stuck at the moment.
 
I even found more erroneus data (null & chopped) but kept it = for brevity.
 
Thanks and if someone needs more input just let me know,
 
Corne
 
Below my testing code;
   Integer telerNummer =3D new Integer(131505);
&= nbsp;  Short productNummer =3D new Short("310");
&nb= sp;  Integer weekNummer =3D new Integer(200852);
   String sorteringNaam =3D "PGE55";
 &nbs= p; Integer mutatieDatum =3D new Integer(200847);
   = Short percentage =3D new Short("11");

   Connection conn = =3D java.sql.DriverManager.getConnection(driverURL, user, password);=
   PreparedStatement ps =3D conn.prepareStatement(sql);<= br>   ps.setShort(1, percentage);
   ps.setInt( 2, mutatieDatum);
   ps.setI= nt(3, telerNummer);
   ps.setShort(4, productNummer);
=    ps.setInt(5, weekNummer);
   ps.setStri= ng(6, sorteringNaam);
   int retval =3D ps= .executeUpdate();
   System.out.printl= n("UPDATED RECORDS:" + retval);

   AanvoerVerwac= htingRegel record =3D new AanvoerVerwachtingRegel();
   r= ecord.setRelatieNummer(telerNummer);
   record.setWeekNum= mer(weekNummer);
   record.setGroepFinancieel(productNumm= er);
   record.setSortering(sorteringNaam);
   = record.setMutatieWeek(mutatieDatum);
   record.setPercent= age(percentage);

   SqlMapClient = vdn_SqlMapClient =3D VDN_SqlMapClient.getSqlMapInstance();
  &= nbsp;AanvoerVerwachtingRegelDAO aanvoerVerwachtingRegelDAO =3D new AanvoerV= erwachtingRegelDAOImpl(vdn_SqlMapClient);
   try {
 &n= bsp;  int result1 =3D aanvoerVerwachtingRegelDAO.updateByPrimaryK= eySelective(record);
    System.out.println("UP= DATED RECORDS updateByPrimaryKeySelective:" + result1);  &nb= sp; 
   } catch (Exception e) {
    e.prin= tStackTrace();
   }
   
try {
    re= cord.setSortering("PGE65");
    int result= 2 =3D aanvoerVerwachtingRegelDAO.updateByPrimaryKey(record);
  = ;  System.out.println("UPDATED RECORDS updateByPrimaryKey:&q= uot; + result2);
   } catch (Exception e) {
    e.prin= tStackTrace();
   }
   AanvoerVerwachtin= gRegelExample example =3D new AanvoerVerwachtingRegelExample();
 &n= bsp; AanvoerVerwachtingRegelExample.Criteria criteria =3D example.crea= teCriteria();
   criteria =3D criteria.andRelatieNummerEq= ualTo(telerNummer);
   criteria =3D criteria.andGroepFinancieelEqualTo(productNu= mmer);
   criteria =3D criteria.andWeekNummerEqualTo(week= Nummer);
   criteria =3D criteria.andSorteringEqualTo(sor= teringNaam);

   try {
    int = result3 =3D aanvoerVerwachtingRegelDAO.updateByExample(record, example);     System.out.println("UPDATED RECORDS updateByEx= ample:" + result3);
   } catch (Exception e) {
&n= bsp;   e.printStackTrace();
   }

&n= bsp;  try {
    int result4 =3D aanvoerVer= wachtingRegelDAO.updateByExampleSelective(record, example);
    System.out.println("UPDATED RECORDS updateByEx= ampleSelective:" + result4);
   } catch (Exception e= ) {
    e.printStackTrace();
   }<= /font>

------=_Part_2489_27870453.1227601693237--