Re: Strange executing batch

From: "Alexander V(dot) Morokhovets" <efdi(at)shamrock-games(dot)ru>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Strange executing batch
Date: 2003-08-18 10:45:07
Message-ID: 192685434015.20030818174507@shamrock-games.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Greetings,

IB> Class.forName("org.postgresql.Driver");
IB> Connection c = DriverManager.getConnection("jdbc:postgresql:....");
IB> PreparedStatement p = c.prepareStatement("insert into test(test) values(?)");
IB> c.setAutoCommit(false);
IB> for (int i = 0; i < 1000; i++) {
IB> p.setString(1, "test"+i);
IB> p.addBatch();
IB> }
IB> p.executeBatch();

IB> If at executing executeBatch() on 500 statement error is arised ,that
IB> for some reason first 499 statement are committed.

Any suggestions/thoughts on the question? I'm not sure this is a JDBC
issue but the problem looks dangerous.

--
Alexander V. Morokhovets
+7 3832 132528

Shamrock Games
efdi(at)shamrock-games(dot)ru
http://www.shamrock-games.ru

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2003-08-18 11:11:22 Re: patch: add a finalizer to AbstractJdbc1Statement
Previous Message Paul Thomas 2003-08-18 10:38:22 Re: patch: add a finalizer to AbstractJdbc1Statement