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