473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Transactions across connections.

I have 3 function in my component . all 3 something are like this

Open Connection
Issue SQL statements(insert /update/delete)
Close connection
Now I have an application that uses these 3 functions in various parts.
I want this application to manage transaction.

When doing operation1 this is what I need

Start Transaction
Call Function1
Call Function2
Call Function3
Commit transaction

When doing operation2 this is what I need
Start Transaction
Call Function1
Call Function3
Commit transaction

So in short I want to manage transactions across connection to the same
DB.

Is this possible with ADO.Net or Data Access Application Blocks? Or
Should I go for System.Transaction(have not read that yet).

Thanks
BCR

Feb 10 '06 #1
2 1286
You cannot make transactions with more than one connection. You can do
the following.

Open ConnectionA
Start Transaction
Call Function1 (using ConnectionA)
Call Function2 (using ConnectionA)
Call Function3 (using ConnectionA)
Commit transaction
Close Connection

You can try to create 3 transactions (with 3 conections) and commit
then only if the 3 Functions success. Example:

Open ConnectionA
Open ConnectionB
Open ConnectionC
Start TransactionA
Start TransactionB
Start TransactionC
Call Function1 (using ConnectionA)
Call Function2 (using ConnectionB)
Call Function3 (using ConnectionC)
Commit transactions A, B, C if success, else rollback.
Close Connections A, B, C

Feb 10 '06 #2

Will try these out.
THanks for your help
CRB

Feb 10 '06 #3

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

Similar topics

11
by: Alban Hertroys | last post by:
Oh no! It's me and transactions again :) I'm not really sure whether this is a limitation of psycopg or postgresql. When I use multiple cursors in a transaction, the records inserted at the...
1
by: RJN | last post by:
Hi I have a transaction requirement that spawns across components. Typical example is saving address, order etc. Each of these components will do their part of transaction. If any of the...
3
by: Lada 'Ray' Lostak | last post by:
Hello ppl, Imagine some online system, based on PgSql. There are 'many' parts which depends on each other. I will give small example, but instead of simple table imagine changing tenths various...
8
by: Allan Ebdrup | last post by:
I've implemented transactions in my dotNet 2.0 project using System.Transactions and TransactionScope. --- TransactionOptions options = new TransactionOptions(); options.IsolationLevel =...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.