
MTS commited data when it shouldn't
Hi,
I have a class. In it I have a function that has 2 updates to 2 different
tables in the database like this:
Public Function Delete()
On Error GoTo ErrorHandler
Set adConnection = New ADODB.Connection
adConnection.Open GetConnectionString()
SQLStm = "UPDATE ReceiptPO SET Status = " & DELETED
adConnection.Execute (SQLStm)
SQLStm = "UPDATE ReceiptItem SET Status = " & DELETED & " WHERE SellerID
= '" & SellerID
adConnection.Execute (SQLStm)
Delete = SUCCESS
GetObjectContext.SetComplete
Exit Function
ErrorHandler:
Delete = DB_ERROR
GetObjectContext.SetAbort
End Function
In the second SQLStm, I deliberately didn't close the quotation after
SellerID (SellerID is string).
When I ran the function from asp (with Transaction=Required; the class is of
type "Uses Transaction".), it did the first update whereas it shouldn't have
done it because of the second update error!!!
Shouldn't MTS roll back all transaction in case of error? Correct me if I'm
wrong.
Thanks,
Pauline