Received: from ext1.ics.forth.gr (mailgate.ics.forth.gr [139.91.1.2]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4S8mFA06751 for ; Mon, 28 May 2001 04:48:16 -0400 (EDT) (envelope-from alexaki@ics.forth.gr) Received: from ismene.ics.forth.gr (mailhost.ics.forth.gr [139.91.157.51]) by ext1.ics.forth.gr (8.9.3/ICS-FORTH/V8.2.5-GATE) with ESMTP id LAA25723; Mon, 28 May 2001 11:48:01 +0300 (EET DST) Received: from sappho.ics.forth.gr (sappho-lane.ics.forth.gr [139.91.157.50]) by ismene.ics.forth.gr (8.8.8/ICS-FORTH/V3) with ESMTP id LAA11330; Mon, 28 May 2001 11:43:35 +0300 (EET DST) Posted-Date: Mon, 28 May 2001 11:43:35 +0300 (EET DST) Organization: Received: from localhost (alexaki@localhost) by sappho.ics.forth.gr (8.9.3/ICS-FORTH/V8.2.2C-INTNULL) with ESMTP id LAA19640; Mon, 28 May 2001 11:42:24 +0300 (EEST) X-Authentication-Warning: sappho.ics.forth.gr: alexaki owned process doing -bs Date: Mon, 28 May 2001 11:42:19 +0300 (EEST) From: Alexaki Sofia To: pgsql-interfaces@postgresql.org cc: peter@retep.org.uk Subject: jdbc: Batch updates-Prepared Statements Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200105/111 X-Sequence-Number: 1641 Hello, At postgresql JDBC driver a Statement.executeBatch() command is equivalent to a transaction containing the update commands of the batch. I think this is not compatible with java jdbc documentation where states that when an Statement.executeBatch() command is executed the batch of commands are executed but no in a new transaction. If you want to create a new transaction you have to state it explicitly. That is you should turn off autocommit and finally execute the Connection.commit command. According to current implementation I can't have multiple Statement.executeBatch() commands in one transaction. I also want to ask whether in postgresql JBDC driver 'Prepared statements' are more efficient than 'Statements'. thank you in advance. Regards, Sofia Alexaki