R: R: connectorJ huge table problem
Leonardo, Earlier you said that a statement without a parameter ('?') works, but one with a parameter doesn't. In both cases, are you still using a PreparedStatement? -Mark yes, it is always a preparedstatement. If you need more details (or you want me to try something else) just ask! Thank you Leonardo -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
R: connectorJ huge table problem
Are you using a streaming connection? ehm... how do I know? My conn string is jdbc:mysql://192.168.0.253:3000/LETSPARTY1?autoReconnect=yes where 192.168.0.253 is a machine on my LAN... -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
R: connectorJ huge table problem
I have also weird results: I access data by ID, which is a primary key in the table. Some times (again, very random behaviour) I get 4 rows back (instead of just 1) and the data I get is always 1275749989 This happens with random IDs. the code to check this is: [..] ResultSet rs = ps1.executeQuery(); boolean c = false; while (rs.next()) { int g = rs.getInt(2); if (c) { // this shouldn't happen, because I'm selecting by ID, but it happens! System.out.println(m + + g); } c = true; } -Messaggio originale- Da: Leonardo Francalanci [mailto:[EMAIL PROTECTED] Inviato: martedì 22 giugno 2004 14.43 A: Mysql Oggetto: connectorJ huge table problem 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(ServerPrepa redStateme 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() * 6400).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() * 6400).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 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
R: connectorJ huge table problem
Dude. I wouldn't post your server ip here. ouch. Well, it's a LAN address! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
R: connectorJ huge table problem
A non-streaming connection will place the resultset in memory. With large tables you can run out of memory and the application will stop. I get only 1 record per time (accessing by key), so I don't think it could be an issue. Thank you anyway! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
R: connectorJ huge table problem
It only happens if I use the PreparedStatement.setInt(...) Using a statement like SELECT * FROM PARTITIONED_B WHERE ID= + m; instead of SELECT * FROM PARTITIONED_B WHERE ID=?; preparedStetement.setInt(1, m); (which is more correct) works. If nobody has a clue I will report a bug in a couple of days... -Messaggio originale- Da: Leonardo Francalanci [mailto:[EMAIL PROTECTED] Inviato: martedì 22 giugno 2004 15.09 A: Mysql Oggetto: R: connectorJ huge table problem I have also weird results: I access data by ID, which is a primary key in the table. Some times (again, very random behaviour) I get 4 rows back (instead of just 1) and the data I get is always 1275749989 This happens with random IDs. the code to check this is: [..] ResultSet rs = ps1.executeQuery(); boolean c = false; while (rs.next()) { int g = rs.getInt(2); if (c) { // this shouldn't happen, because I'm selecting by ID, but it happens! System.out.println(m + + g); } c = true; } -Messaggio originale- Da: Leonardo Francalanci [mailto:[EMAIL PROTECTED] Inviato: martedì 22 giugno 2004 14.43 A: Mysql Oggetto: connectorJ huge table problem 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(ServerPrepa redStateme 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() * 6400).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() * 6400).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 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: R: connectorJ huge table problem
Leonardo Francalanci [EMAIL PROTECTED] wrote on 22/06/2004 14:26:54: A non-streaming connection will place the resultset in memory. With large tables you can run out of memory and the application will stop. I get only 1 record per time (accessing by key), so I don't think it could be an issue. It looks as if you are being over-complex anyway. Isn't what you want SELECT * FROM PARTITIONED_B ORDER BY RAND() LIMIT 1 ; which picks a single random record. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
R: R: connectorJ huge table problem
It looks as if you are being over-complex anyway. Isn't what you want SELECT * FROM PARTITIONED_B ORDER BY RAND() LIMIT 1 ; which picks a single random record. No, I have to know which is the ID I pick before doing the select (because I splitted my data, and when I access the splitted table I have code like: int table = ((m / 200) + 1); String query = SELECT * FROM PARTITIONED_B_ + table + WHERE ID=?; ) Thank you anyway -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
R: connectorJ huge table problem
What happens if you use a nightly snapshot of Connector/J from http://downloads.mysql.com/snapshots.php? I tried, but I still have the same problem: java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException: 6 at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStateme nt.java:924) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1622) I have no idea... I tried adding a smaller table (10 rows) and executing the same queries against this table: it doesn't work, while on another server (another machine) it works! It worked until I did a lot of inserts on one table and created splitted-version tables of the big one. Hence I'm not sure the problem is on the client... -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: R: R: connectorJ huge table problem
Next time you come over, maybe you can help hold him or take the shot. He's such a pain to take pictures of, he walks right up to the camera. On Tue, 2004-06-22 at 09:50, Leonardo Francalanci wrote: It looks as if you are being over-complex anyway. Isn't what you want SELECT * FROM PARTITIONED_B ORDER BY RAND() LIMIT 1 ; which picks a single random record. No, I have to know which is the ID I pick before doing the select (because I splitted my data, and when I access the splitted table I have code like: int table = ((m / 200) + 1); String query = SELECT * FROM PARTITIONED_B_ + table + WHERE ID=?; ) Thank you anyway -- Richard F. Rebel [EMAIL PROTECTED] t. 212.239. signature.asc Description: This is a digitally signed message part
R: R: R: connectorJ huge table problem
Next time you come over, maybe you can help hold him or take the shot. He's such a pain to take pictures of, he walks right up to the camera. Mmmh... my English is very bad... I can't understand... is it a joke or just a mistake? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: R: R: R: connectorJ huge table problem
I think a mistake. I did not understand it either Leonardo Francalanci To: Richard F. Rebel [EMAIL PROTECTED] [EMAIL PROTECTED]cc: ''Mysql ' ' [EMAIL PROTECTED] tel.ie Fax to: Subject: R: R: R: connectorJ huge table problem 06/22/2004 10:18 AM Next time you come over, maybe you can help hold him or take the shot. He's such a pain to take pictures of, he walks right up to the camera. Mmmh... my English is very bad... I can't understand... is it a joke or just a mistake? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: R: R: connectorJ huge table problem
Richard F. Rebel wrote: Next time you come over, maybe you can help hold him or take the shot. He's such a pain to take pictures of, he walks right up to the camera. Yeah, I also have problems taking snapshots of my cat... use FEL to pre-flash so he won't blink when you take the actual picture. :-))) - Cs. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: R: connectorJ huge table problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Leonardo Francalanci wrote: What happens if you use a nightly snapshot of Connector/J from http://downloads.mysql.com/snapshots.php? I tried, but I still have the same problem: java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException: 6 at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStateme nt.java:924) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1622) I have no idea... I tried adding a smaller table (10 rows) and executing the same queries against this table: it doesn't work, while on another server (another machine) it works! It worked until I did a lot of inserts on one table and created splitted-version tables of the big one. Hence I'm not sure the problem is on the client... Leonardo, Earlier you said that a statement without a parameter ('?') works, but one with a parameter doesn't. In both cases, are you still using a PreparedStatement? -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 iD8DBQFA2Io7tvXNTca6JD8RAiwRAJ9prt9UcID34Sz8/GmfF271y87IRQCfcaKO NTfj5s43qUDRjV27RiHOZzc= =6tVu -END PGP SIGNATURE- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]