Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 90343 invoked from network); 21 Jun 2007 10:36:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jun 2007 10:36:02 -0000 Received: (qmail 12945 invoked by uid 500); 21 Jun 2007 10:36:02 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 12921 invoked by uid 500); 21 Jun 2007 10:36:01 -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 12910 invoked by uid 99); 21 Jun 2007 10:36:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2007 03:36:01 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [212.27.42.27] (HELO smtp1-g19.free.fr) (212.27.42.27) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2007 03:35:57 -0700 Received: from Arnaud (lit75-2-82-229-189-196.fbx.proxad.net [82.229.189.196]) by smtp1-g19.free.fr (Postfix) with ESMTP id 593C01AB2BC for ; Thu, 21 Jun 2007 12:35:36 +0200 (CEST) From: =?iso-8859-1?Q?Arnaud_Lema=EEtre?= To: Subject: Multi result sets support broken in ibatis-2.3.0.677 Date: Thu, 21 Jun 2007 12:35:48 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.5510 thread-index: AceyU3+U8emE1KUrRDSP54tTtqJnEwBnAZXg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-Id: <20070621103536.593C01AB2BC@smtp1-g19.free.fr> X-Virus-Checked: Checked by ClamAV on apache.org Hi, Following my previous mail, i did jdbc quick and dirty equivalent to my programm. (without changing my db configuration) So Ibatis 2.3 seems to be broken regarding multi result sets support. And apparently it=92s not only when resultclass is set to =AB int, int = =BB since I did some different tests returning POJOs etc.=20 If i can fix it myself i'll submit a patch. Hope it=92s not tricky. Regards, Arnaud Here is the test : package com.test; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class test { public static void main( String[] args ) { new test( args ); } public void testJDBCConnection() throws Exception { Class.forName( "com.mysql.jdbc.Driver" ); =09 String url =3D "jdbc:mysql://myHost:3306/myDatabase?autoReconnect=3Dtrue&allowMultiQueri= es=3Dtr ue&characterEncoding=3DUTF-8&characterSetResults=3DUTF-8"; =09 Connection conn =3D DriverManager.getConnection( url, "myDatabase", "myPassword" ); =09 try { =09 String sqlString =3D "SELECT 1+1; SELECT 2+2; SELECT 3+3"; System.out.println("Before executing"); =09 =09 Statement stmt =3D conn.createStatement(); stmt.execute( sqlString ); for (;;) { int updateCount =3D stmt.getUpdateCount(); if (updateCount >=3D 0) { // report rows affected... } else { ResultSet rs =3D stmt.getResultSet(); if (rs =3D=3D null) break; if ( rs.next() ) System.out.println( "result :" + rs.getInt(1) ); // process resultset .... } stmt.getMoreResults(); } =09 System.out.println("After executing"); } catch (Exception e) { System.out.println("Exception: " + e); } =09 } public test( String[] args ) {=20 try { =09 testJDBCConnection();=20 } catch (Exception e) { System.out.println("Exception: " + e); } } } And the output : Before executing result :2 result :4 result :6 After executing