[MonetDB-users] Jdbc errors : no prepared statement
Hi, trying to populate my database using jdbc, I encounter the following error : java.sql.SQLException: no prepared statement with the given id at nl.cwi.monetdb.jdbc.MonetConnection $ResponseList.executeQuery(MonetConnection.java:2219) at nl.cwi.monetdb.jdbc.MonetConnection $ResponseList.processQuery(MonetConnection.java:1978) at nl.cwi.monetdb.jdbc.MonetConnection.commit(MonetConnection.java:348) The error comes at a seemingly random time, depending on the run, I could insert 22000 rows, then 9800, etc. I am using the latest published version (MaySP1). Is this a know problem ? Franck
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Franck Routier wrote:
Is this a know problem ?
Fabian; Is this the same Java 1.6 bug we hit when tried to load the mondrian dataset? Stefan -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREKAAYFAkpTgh0ACgkQYH1+F2Rqwn04QQCfaBI2abT+P0eXCIvbFO8nh7Pz u1EAn2IcPT67lW/lQjqCC/3A6nl59w/k =bQiJ -----END PGP SIGNATURE-----
On 07-07-2009 19:13:01 +0200, Stefan de Konink wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Franck Routier wrote:
Is this a know problem ?
Fabian; Is this the same Java 1.6 bug we hit when tried to load the mondrian dataset?
As far as I remember, this had nothing to do with Java, as it is the server telling the client that the prepare handle it used does not (no longer) exist.
On 07-07-2009 09:59:30 +0200, Franck Routier wrote:
trying to populate my database using jdbc, I encounter the following error :
java.sql.SQLException: no prepared statement with the given id at nl.cwi.monetdb.jdbc.MonetConnection $ResponseList.executeQuery(MonetConnection.java:2219) at nl.cwi.monetdb.jdbc.MonetConnection $ResponseList.processQuery(MonetConnection.java:1978) at nl.cwi.monetdb.jdbc.MonetConnection.commit(MonetConnection.java:348)
The error comes at a seemingly random time, depending on the run, I could insert 22000 rows, then 9800, etc.
I am using the latest published version (MaySP1).
Is this a know problem ?
The server-side prepared handle could be garbage collected somehow. Is the application by chance creating the prepared statement inside a transaction?
On 08-07-2009 14:16:26 +0200, Franck Routier wrote:
Is the application by chance creating the prepared statement inside a transaction?
No, AFAICT the statement is created once on initialization and reused during the whole loading process.
how does the code look like? something like this? con.setAutoCommit(false); pstmt = con.prepareStatement("INSERT INTO bla VALUES (?, ?)"); while (hasMoreStuff) { ... pstmt.setInt(1, something1); pstmt.setInt(2, something2); pstmt.addBatch(); if (counter % 5000 == 0) { pstmt.executeBatch(); pstmt.clearBatch(); } } if (counter % 5000 != 0) { pstmt.executeBatch(); pstmt.clearBatch(); } con.setAutoCommit(true); ...
Hi Fabian, in fact I am using CloverETL [http://www.cloveretl.com/clover-etl/] to read from postgresql and write to Monetdb. I am using a component called 'DBOutputTable', whose code can be seen here : http://svn.berlios.de/wsvn/cloveretl/trunk/cloveretl.component/src/org/jetel... Essentialy it will init() and create the statement, and then runInNormalMode() or runInBatchMode() (depending on the configuration given) while there is data coming in. So it is quite similar in concept to your code, but much less straightforward ! Le lundi 13 juillet 2009 à 10:19 +0200, Fabian Groffen a écrit :
On 08-07-2009 14:16:26 +0200, Franck Routier wrote:
Is the application by chance creating the prepared statement inside a transaction?
No, AFAICT the statement is created once on initialization and reused during the whole loading process.
how does the code look like? something like this?
con.setAutoCommit(false); pstmt = con.prepareStatement("INSERT INTO bla VALUES (?, ?)"); while (hasMoreStuff) { ... pstmt.setInt(1, something1); pstmt.setInt(2, something2); pstmt.addBatch(); if (counter % 5000 == 0) { pstmt.executeBatch(); pstmt.clearBatch(); } } if (counter % 5000 != 0) { pstmt.executeBatch(); pstmt.clearBatch(); } con.setAutoCommit(true); ...
------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
participants (3)
-
Fabian Groffen
-
Franck Routier
-
Stefan de Konink