-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Leonardo Francalanci wrote:

> I have a large table (64,000,000 rows).
> Everything was fine when the table was 16,000,000 rows,
> now connectorJ crashes:
>
> java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException: 6
>       at
>
com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStateme
> nt.java:908)
>       at
> com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1622)
>
>
>
> my code is:
>
> java.sql.Connection regularConn =
ConnectionHandler.getRegularConnection();
>
> java.sql.PreparedStatement ps1 = null;
> //letspartyConn.prepareStatement(query);
> for (int i = 0; i < 1000; i++) {
>  String query = "SELECT * FROM PARTITIONED_B WHERE ID=?";
>  ps1 = regularConn.prepareStatement(query);
>  int m = new Double(Math.random() * 64000000).intValue();
>  ps1.setInt(1, 12352597);
>  ResultSet rs = ps1.executeQuery();
>  while (rs.next()) {
>   int g = rs.getInt(2);
>  }
>  rs.close();
>  ps1.close();
>
> }
> regularConn.close();
>
>
>
>
> I debugged the code, and it seems to happen when it reads a long
> (readLongLong),
> but I don't have any data in my db that is long (everything is int, and in
> fact
> every time the method readLongLong gets called it crashes).
> The error seems very random (sometimes happens, some others no, and always
> with different IDs),
> I have no idea.
>
> Note that using the prepared statement in the proper way, that is:
>
> String query = "SELECT * FROM PARTITIONED_B WHERE ID=?";
> ps1 = regularConn.prepareStatement(query);
> for (int i = 0; i < 1000; i++) {
>  int m = new Double(Math.random() * 64000000).intValue();
>  ps1.setInt(1, 12352597);
>  ResultSet rs = ps1.executeQuery();
>  while (rs.next()) {
>   int g = rs.getInt(2);
>  }
>  rs.close();
> }
> ps1.close();
> regularConn.close();
>
>
> everything works fine. Re-creating the PreparedStatement each time
gives me
> the error
> above when I call ResultSet rs = ps1.executeQuery().
>
> I'm using connectorJ 3.1.2, mysql 4.1.2

What happens if you use a nightly snapshot of Connector/J from
http://downloads.mysql.com/snapshots.php?

        -Mark


- --
Mr. Mark Matthews
MySQL AB, Software Development Manager, J2EE and Windows Platforms
Office: +1 708 332 0507
www.mysql.com

MySQL Guide to Lower TCO
http://www.mysql.com/it-resources/white-papers/tco.php
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA2EQltvXNTca6JD8RAr/LAJ4vKGikqzJTi/tRu2rq0rqbKvOEWACgqKG1
1mKgveQTUG+3c99Qb7XPiAM=
=g+xo
-----END PGP SIGNATURE-----

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to