Dear Tapks
two phase commit is handled automatically by the combination of MSDTC and COM+ u don't have to write extra code for it if u have devloped a COM+ component which can did tasks on a single Back-end server then it can do it for multiple servers
i think u know what 'two phase commit' means actually its termonlagy in which MSDTC handles transaction for dispersed back-end servers,more than 1 server..
Regards
Nouman
Thanks a lot. Can u please let me know how to implement the same in Visual Basic?
The problem is :
There are 2 database servers & my COM object is in my Pc & all re connected in LAN. I want to insert recoreds in the database of both server at the saem time. If any one fails I wnat to roll back the other one. How to do this in VB6 under Win 2000?
dear tapks
okay i am posting a snippet of code which help u out
u don't have to worry about the 2 databse it will be done by MSDTC and Components Service and code of 'SetAbort' and 'SetCOmmit' ,'SetAbort' for aborting the whole transaction no matter if it is inserting in 2 differnt databse servers and 'SetComplete' will do a safe atomic transaction i hope u got it..here is the code
On Error GoTo ErrH
Dim objDOCodes As New clsDOCodes
Dim ObjContext As ObjectContext
Set ObjContext = GetObjectContext()
'Do what ever code for ur insertion in the lines below
'i am pasting some dummy code for ur ease
Dim objCmdTask As New ADODB.Command
With objCmdTask
.CommandType = adCmdStoredProc
Set .ActiveConnection = DBConnection(varInfo (INT_CONNECTSTRING))
.CommandText = STR_STP_ORD_INSERT_TASK
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.