473,433 Members | 1,874 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,433 software developers and data experts.

ADO Transaction Question

I have a long and complex data manipulation algorithm written in ADO that
performs about 20 different data manipulation processes sequentially. I
intend to finalise this function (lets call it AddSessions() by setting it
to perform within a Transaction with Rollback etc. Only problem is that, as
per good coding principles, some of the routines that manipulate the data
are contained in subroutines that are called by the main routine. eg

Function AddSessions()

call DeleteExisting()
call AddAllocations()

End Function

These also use ADO. How does this work with transactions? In order to
encapsulate the whole thing within a single transaction will I need to
'promote' the code from these subroutine calls into the main function?


Nov 13 '05 #1
3 2818
On Wed, 22 Dec 2004 00:43:29 GMT, "Andrew Chanter"
<he****@radsolutions.com.au> wrote:

Not at all. As long as all functions use the same connection object
(which has the BeginTrans and other methods), you are fine.
When a problem occurs in a subroutine, just use Err.Raise to signal
that to the main function, which can trap that error in its error
handler and perform a connection.Rollback.

-Tom.

I have a long and complex data manipulation algorithm written in ADO that
performs about 20 different data manipulation processes sequentially. I
intend to finalise this function (lets call it AddSessions() by setting it
to perform within a Transaction with Rollback etc. Only problem is that, as
per good coding principles, some of the routines that manipulate the data
are contained in subroutines that are called by the main routine. eg

Function AddSessions()

call DeleteExisting()
call AddAllocations()

End Function

These also use ADO. How does this work with transactions? In order to
encapsulate the whole thing within a single transaction will I need to
'promote' the code from these subroutine calls into the main function?


Nov 13 '05 #2
Thanks Tom. Is this also true of .execute statements within the code using
the same connection?
"Tom van Stiphout" <no*************@cox.net> wrote in message
news:mq********************************@4ax.com...
On Wed, 22 Dec 2004 00:43:29 GMT, "Andrew Chanter"
<he****@radsolutions.com.au> wrote:

Not at all. As long as all functions use the same connection object
(which has the BeginTrans and other methods), you are fine.
When a problem occurs in a subroutine, just use Err.Raise to signal
that to the main function, which can trap that error in its error
handler and perform a connection.Rollback.

-Tom.

I have a long and complex data manipulation algorithm written in ADO that
performs about 20 different data manipulation processes sequentially. I
intend to finalise this function (lets call it AddSessions() by setting itto perform within a Transaction with Rollback etc. Only problem is that, asper good coding principles, some of the routines that manipulate the data
are contained in subroutines that are called by the main routine. eg

Function AddSessions()

call DeleteExisting()
call AddAllocations()

End Function

These also use ADO. How does this work with transactions? In order to
encapsulate the whole thing within a single transaction will I need to
'promote' the code from these subroutine calls into the main function?

Nov 13 '05 #3
On Wed, 22 Dec 2004 05:30:11 GMT, "Andrew Chanter"
<he****@radsolutions.com.au> wrote:

Try it. My bet is that it works.
-Tom.

Thanks Tom. Is this also true of .execute statements within the code using
the same connection?
"Tom van Stiphout" <no*************@cox.net> wrote in message
news:mq********************************@4ax.com.. .
On Wed, 22 Dec 2004 00:43:29 GMT, "Andrew Chanter"
<he****@radsolutions.com.au> wrote:

Not at all. As long as all functions use the same connection object
(which has the BeginTrans and other methods), you are fine.
When a problem occurs in a subroutine, just use Err.Raise to signal
that to the main function, which can trap that error in its error
handler and perform a connection.Rollback.

-Tom.

>I have a long and complex data manipulation algorithm written in ADO that
>performs about 20 different data manipulation processes sequentially. I
>intend to finalise this function (lets call it AddSessions() by settingit >to perform within a Transaction with Rollback etc. Only problem is that,as >per good coding principles, some of the routines that manipulate the data
>are contained in subroutines that are called by the main routine. eg
>
>Function AddSessions()
>
>call DeleteExisting()
>call AddAllocations()
>
>End Function
>
>These also use ADO. How does this work with transactions? In order to
>encapsulate the whole thing within a single transaction will I need to
>'promote' the code from these subroutine calls into the main function?
>
>
>


Nov 13 '05 #4

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

Similar topics

1
by: Avanish Pandey | last post by:
Hello All We have 3 differen services (in 3 different server) Service A,B,C . We want to implement distributed transaction when call methods of B and C from A. Is it possible? if yes then how? ...
8
by: Alex | last post by:
Hi, I have a test system that is setup the same as a production system and would like to frequently copy the database over. pg_dump takes a few hours and even sometimes hangs. Are there any...
12
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...
15
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)...
1
by: REB | last post by:
If I create a transaction object for rolling back a insert query in the on click event of a form button can the transaction be tracked across other functions? For example: private void...
2
by: msnews.microsoft.com | last post by:
Hello, I have the scenario. I m building an application either in asp.net or window application. This application is base on n-tier application model. Let us take example of Northwind Database in...
14
by: Jim Michaels | last post by:
mysql_query("START TRANSACTION", $link2); $q2=mysql_query("SELECT pictures.pid AS pid FROM pictures,counter WHERE pictures.pid>counter.pid LIMIT 1", $link2); if ($row2=mysql_fetch_assoc($q2)) {...
0
by: tony | last post by:
Hello! Below I have three methods it's SavePost, SavePostSetUpTableFlg and SavePostBlowStepFlg. I want to use transaction to keep the data synchronized. All or nothing must be executed. When...
3
by: sifrah | last post by:
Hi All, My SQL server transaction log is getting bigger every day and my HDD if running out of space. So i follow the MS KB about how to Shrinking the Transaction Log. After doing so the log is...
10
by: Lit | last post by:
Hi, using ADO.NET 2.0, VS.NET 2005, SQL2005 I need to execute several Stored Procedures under one transaction. Can I use just one command/transaction or have to use multiple ( then commit or...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
1
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.