lol...if we don't check for that flag, all other drivers that actually don't
support multiple result sets will fail.

Maybe you can submit a patch to the MySQL driver.  seems like it would be a
constant no?

public boolean supportsMultipleResultSets() {
 return true;
}

Alternatively you could try proxying the driver so that it returns the right
value.

Clinton

On 6/26/07, Arnaud Lemaître <[EMAIL PROTECTED]> wrote:

Hi Clinton,

I've posted a bug report on JIRA and finally discovered the problem
(then post a comment on this bug report :-) Please, see my notes.

For my jdbc driver/Mysql server combination this line :
(listed on the report)

...
   if (!stmt.getConnection().getMetaData().supportsMultipleResultSets()) {
     return false;
   }
...
}

is always returning false. So it's definetely a jdbc driver or server
issue.
That said, may be it's not a good design to rely on this flag...
What do you think?

For my particular needs, i've just removed this test, and it works fine.

Thanks,

Arnaud
________________________________________
De: Clinton Begin [mailto:[EMAIL PROTECTED]
Envoyé: lundi 25 juin 2007 23:11
À: [email protected]
Objet: Re: Multi result sets support broken in ibatis-2.3.0.677

Thanks for the input here, and yes we hope you can fix it. :-)

Question though: Are you suggesting that it does work in versions previous
to 2.3?

Cheers,
Clinton



On 6/21/07, Arnaud Lemaître <[EMAIL PROTECTED]> wrote:
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's not only when resultclass is set to « int, int » since
I did some different tests returning POJOs etc.

If i can fix it myselfi'll submit a patch. Hope it's 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 " );

String url =

"jdbc:mysql://myHost:3306/myDatabase?autoReconnect=true&allowMultiQueries=tr
ue&characterEncoding=UTF-8&characterSetResults=UTF-8";

Connection conn = DriverManager.getConnection( url,
"myDatabase", "myPassword" );

try
{
String sqlString = "SELECT 1+1; SELECT 2+2; SELECT
3+3";
System.out.println("Before executing");


Statement stmt = conn.createStatement();
stmt.execute( sqlString );
for (;;) {
int updateCount = stmt.getUpdateCount();
if (updateCount >= 0) {
// report rows affected...
}
else {
ResultSet rs = stmt.getResultSet();
if (rs == null)
break;
if ( rs.next() )
System.out.println( "result
:" + rs.getInt(1) );
// process resultset ....
}
stmt.getMoreResults();
}

System.out.println("After executing");
}
catch (Exception e)
{
System.out.println("Exception: " + e);
}

}

public test( String[] args ) {
try
{
testJDBCConnection();
}
catch (Exception e)
{
System.out.println("Exception: " + e);
}
}

}

And the output :

Before executing
result :2
result :4
result :6
After executing




Reply via email to