-
Transaction commit
Hi,
In our application for a particular we have to update two databases and a
set of tables in each database.
But the consitency should be maintained, that the whole transaction should
be saved only if all the inserts and updates in both the databases succeed.
Without going for MTS or COM+ what is the alternative way to do that?
Any suggestion or idea will be greatly appreciated.
Regards
Dharan
-
Re: Transaction commit
Hey Dharan,
You can use transactions on the ADODB.Connection object.
To start a transaction there is a method called '.BeginTrans'.
To commit the transaction call '.CommitTrans' and if there is an error or
you want to cancel all the updates call '.RollbackTrans'
For example...
-----------------------------
Dim objCon As ADODB.Connection
Set objCon = New ADODB.Connection
' Begin Transaction
objCon.BeginTrans
' Commit updates
objCon.CommitTrans
' Don't Commit any updates
objCon.RollbackTrans
-----------------------------
Hope this helps!
Rich
"Prakash Dharan" <dharan@facilityoffice.com> wrote:
>Hi,
>
>In our application for a particular we have to update two databases and
a
>set of tables in each database.
>
>But the consitency should be maintained, that the whole transaction should
>be saved only if all the inserts and updates in both the databases succeed.
>Without going for MTS or COM+ what is the alternative way to do that?
>
>Any suggestion or idea will be greatly appreciated.
>
>Regards
>Dharan
>
>
-
Re: Transaction commit
Hi Prakash.
You have to manually control it.
Like:
a.starttransaction
b.starttransaction
on error goto abort
....
a.commit
b.commit
exit sub
Abort:
a.rollback
b.rollback
--
Miha
www.spin.si
"Prakash Dharan" <dharan@facilityoffice.com> wrote in message
news:3b32d80c@news.devx.com...
> Hi,
>
> In our application for a particular we have to update two databases and a
> set of tables in each database.
>
> But the consitency should be maintained, that the whole transaction should
> be saved only if all the inserts and updates in both the databases
succeed.
> Without going for MTS or COM+ what is the alternative way to do that?
>
> Any suggestion or idea will be greatly appreciated.
>
> Regards
> Dharan
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks