1
Vote

Rollback in stored procedure conflicts with TransactionScope

description

When an error occurs in one of the following stored procedures (usp_MachineInsert, usp_ProcessorInsert, usp_GraphicsProcessorInsert, usp_TargetSiteInsert, usp_AssemblyInsert, usp_ThreadInsert, usp_AppDomainInsert, usp_ProcessInsert, usp_ExceptionInsert), you get an error in SqlExceptionProvider.cs in the private "Publish" method. The error says "the number of COMMITs or ROLLBACKs does not match the number of BEGIN TRANSACTIONs" (These are my words, I don't remember exactly the error message).
 
The reason for this problem is that there is a "ROLLBACK" in the stored procedure and aslo the TransactionScope in the Publish method tries to rollback the transaction due to the error.

comments