
MTS, VB and rolling back transactions
I'm testing out the rollback feature of MTS and MSDTC, and have a VB
component running under MTS, which is trying to roll back a transaction:
***************************************
Function testFunction() as Boolean
On error goto uh_oh
Dim objContext As ObjectContext
Set objContext = GetObjectContext
sql = "exec server1.dbo.www_updateClientInformation 700, 'hello'"
myConnection.Execute (sql)
objContext.SetAbort
testFunction= True
Exit Function
uh_oh:
debug.print(err.description)
End Function
***********************************************************
For whatever reason, the transaction doesn't actually roll back-- the value
"hello" is always placed into the field/record indicated by the stored
procedure above. I change the value back to something else run the code
again, and "hello" winds up in there again, even after SetAbort has been
run.
I'm using SQL Server 7.0 as the backend, and it has the RPC service running,
along with the DTC service. My VB component is compiled with the "Supports
Transactions" flag on it. Am I doing something really wrong here?