Search Postgresql Archives

Re: strange commit behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Flavio Palumbo, 18.11.2008 10:01:
I tested this tool under MySql and Oracle and everything went as expected.

Unfortunately postgres seems to work in a different way, cause if there is
just one error while the transaction is active I'm not able to commit the
well formed data in the db, no matter if the good records were inserted
sooner or later the error.

Does this behavior appears right for postgres ?

Yes this is the way Postgres works (been there as well)

There is any way or workaround to achieve my goal ?

You need to wrap each UPDATE/INSERT statement with a Savepoint

Savepoint sp = connection.setSavepoint()
try
{
 // do your insert/update/delete here
 connection.release(sp);
}
catch (SQLException sql)
{
 connection.rollback(sp);
}

Thomas


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux