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? 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?
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?
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? > > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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?
...
|
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...
|
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...
|
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)...
|
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...
|
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...
|
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)) {...
|
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...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |