By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,852 Members | 2,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,852 IT Pros & Developers. It's quick & easy.

Ending transaction inside stored function

P: n/a
lnd
This was probably asked n-times but still:

Is there any way to end (commit/rollback) a transaction inside a stored
function?

(The reason why it is good to commit/rollback in a stored procedure is that
in C/S environment it is not uncommon to have a dead client holding
locks(unfinished transactions) in the database. For web applications running
3 tires it is not such an issue actually.
Ending transactions in the database stored procedures engine solves this
issue: engine runs in the database itself and there is little probability
that engine goes down leaving uncleared locks in the database.
In fact DB stored procedures engine can be used as a middle-tire in C/S
environment, eliminating need for another kinds of middle tires)
Thank you in advance,
Laimis

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

Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Wed, Jan 21, 2004 at 10:49:25 -0000,
ln*@hnit.is wrote:
This was probably asked n-times but still:
Yes, see the archives.
Is there any way to end (commit/rollback) a transaction inside a stored
function?


Currently this isn't possible.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #2

P: n/a
Is there any way to end (commit/rollback) a transaction inside a stored
function?


Currently not, but you can RAISE EXCEPTION to terminate the containing
transaction. This will essentially rollback the transaction when it hits
the COMMIT statement (or implied version).

Best Wishes,
Chris Travers
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.