
13 Jul
2009
13 Jul
'09
10:19 a.m.
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); ...