This should be an easy one for those familiar with Postgresql:
My application issues a begin_work
, does a number of operations, and then issues a commit
. The operations and the commit are wrapped inside a try-catch block, whose catch statement performs a rollback
. Assumption: if an error occurs during a SQL operation, Postgresql will automatically rollback the transaction, and therefore my rollback will be redundant but harmless. Is this assumption correct?
(The reason why I'm rollbacking anyway: just in case an exception unrelated to a SQL operation ocurs.)