Catching errors inside transactions

Поиск
Список
Период
Сортировка
От John Taylor
Тема Catching errors inside transactions
Дата
Msg-id 02051514253701.01476@splash.hq.jtresponse.co.uk
обсуждение исходный текст
Ответы Re: Catching errors inside transactions
Re: Catching errors inside transactions
Список pgsql-novice
Hi all,

I'm accessing postgres (7.1) through JDBC.

My application performs a number of UPDATEs, and INSERTs to the database.
If there are any SQL errors, I catch them and deal with them as appropriate
in my code.

However, I now want to put these inside a transaction.

This all works fine, except that if there is an error, postgress automatically
rolls back the transaction, even though I COMMIT at the end.

Is there a way I can stop the errors causing the transaction to fail, or to force
the transaction to commit ?

I don't really want to explicitly check for the existence of a record before an UPDATE/INSERT,
as errors are the exception.


Any ideas ?

Thanks
JohnT


В списке pgsql-novice по дате отправления:

Предыдущее
От: Chris Thompson
Дата:
Сообщение: trigger, transactions, eek
Следующее
От: gerry.smit@lombard.ca
Дата:
Сообщение: Trouble with index in 7.1