473,569 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ending transaction inside stored function

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(unfinishe d 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
2 5281
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*******@postg resql.org

Nov 22 '05 #2
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*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
7474
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I have an series of interactive HTML forms. The user begins a Cookie session. A database connection is opened and a transaction is begun. After the...
3
2151
by: Lada 'Ray' Lostak | last post by:
Hi ! We are moving to PgSql application, with 'typical' style of work. Thin client, huge database. From database is (also) generated whole website. I will use it for explain my current todo. Right now, I am before solving following problem: Someone starts (let's say) adding 'new product'. It mean, he have to add records to many tables,...
12
2189
by: John Sidney-Woollett | last post by:
I have to convert an java web application currently using an Oracle DB back end to one using a Postgres backend. In Oracle much of the application logic is abstracted away from the java middleware layer using stored procedures within the Oracle database. There are certain features in Oracle that appear to be missing from Postgres which are...
11
5214
by: harborboy76 | last post by:
Hi, I have a stored procedure that does a lot of INSERT/UDATE to 3 tables. And When I call the stored procedure, I get a Transaction Log Full error. When I want to do is turning off the transaction log on those 3 tables that the stored procedure is using. Now, since I call the stored procedure on the command line (CLI), where do I run ALTER...
4
5613
by: Rahul Anand | last post by:
Getting SQL Exception when trying to implement Connection based Trasaction using SQL Helper class. I am using the follwing function to execute my stored procs: -=-=-=- ExecuteScalar(ByVal transaction As SqlTransaction, _ ByVal spName As String, _ ByVal ParamArray parameterValues() As Object)
15
9983
by: Zeng | last post by:
Hi, The bigger my C# web-application gets, the more places I need to put in the tedious retrying block of code to make sure operations that can run into database deadlocks are re-run (retried) 3-4 times and give up if after that it's still in deadlock. I'm very sure that many experienced people out there already deal with this issue...
2
8112
by: kanda | last post by:
Hello. I am developing the application (VBA&ODBC, to be exact) which periodically calls the stored procedures in the IBM DB2. A few of the procedures require executing with isolation level RR ( ANSI "SERIALIZABLE" ), not the default; default is CS (ANSI "Read Committed")). The procedure language is SQL. According to the documentation, I...
1
2182
by: Mark | last post by:
Hello, I'm using the following code implementing transactions: Using trans1 As New Transactions.TransactionScope 'Data manipulations here! End using How do I change the transaction isolation level?
2
4191
gauravgmbhr
by: gauravgmbhr | last post by:
hi i am having problem using transactions inside a function i have to insert records in two tables which have interdependent foreign keys. so the insertion should be done inside a transaction and i need to use a single stored procedure to do that. SO can someone help me by telling me how to use transactions inside a function or f...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7678
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7982
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6286
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.