Search Postgresql Archives

Re: [RESEND] Transaction auto-abort causes grief with Spring Framework

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

 



"Tyson Lloyd Thwaites" <tyson.lloydthwaites@xxxxxxxxxxxxxxx> writes:

> Normally if we catch the exception, other dbs (Oracle, MSSQL) will let us
> keep going.

How do you catch exceptions in these other dbs?

The way to do it in Postgres is with the SAVEPOINT command.

> For example, if something goes wrong, I can't even write an event row to our
> auditing table!

This is actually a somewhat more complex example than handling an expected
error. For audit records you really want to be able to commit the audit record
independently of the rest of the transaction. These are called "autonomous
transactions" and there's no built-in support for them in Postgres but you can
put together something equivalent using dblink or a second client connection.

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[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