Re: [RESEND] Transaction auto-abort causes grief with Spring Framework - Mailing list pgsql-general

From Webb Sprague
Subject Re: [RESEND] Transaction auto-abort causes grief with Spring Framework
Date
Msg-id b11ea23c0708171009h3e6983e1p2814770dc27c1936@mail.gmail.com
Whole thread Raw
In response to Re: [RESEND] Transaction auto-abort causes grief with Spring Framework  (Alban Hertroys <alban@magproductions.nl>)
List pgsql-general
> Isn't the 'try' statement rather similar to a 'savepoint' command? I
> realize it would be difficult to override the behaviour of try {...}
> catch (...) {...}, but it shouldn't be too hard to wrap it somehow for
> exceptions in database code.

Yes, but I believe the OP was getting two levels of his application
mixed up:  he was doing something that caused a rollback in the
*database*, then hoping to recover in a catch block in the
*application* without terminating the aborted transaction in the
database.  Or so I gather.

You are right in another post about the purpose and design of
transactions, and don't use the discussion here as a model, though
drivers seem to often do weird stuff with transactions behind your
back.  Psycopg (python) does an implicit begin, so you must commit,
which then starts another begin automatically.  I think you can set  a
handle to do autocommit, but I never do. This seems best because it
forces you to handle transactions explicitly, but I can imagine other
(bad) approaches, and Spring may use them (though I think the
difficulty is that MS-SQL is sloppy, not Spring, and that the OP is
still getting used to TX's and MS-SQL covered up some things that
shouldn't have been covered).

W

pgsql-general by date:

Previous
From: "Belinda M. Giardine"
Date:
Subject: Re: FInding "corrupt" values in UTF-8 tables (regexp question, I think)
Next
From: "Scott Marlowe"
Date:
Subject: Re: Enterprise Wide Deployment