“This SqlTransaction has completed; it is no longer usable.”… configuration error?

I believe this error message is due to a “zombie transaction”.

Look for possible areas where the transacton is being committed twice (or rolled back twice, or rolled back and committed, etc.). Does the .Net code commit the transaction after the SP has already committed it? Does the .Net code roll it back on encountering an error, then attempt to roll it back again in a catch (or finally) clause?

It’s possible an error condition was never being hit on the old server, and thus the faulty “double rollback” code was never hit. Maybe now you have a situation where there is some configuration error on the new server, and now the faulty code is getting hit via exception handling.

Can you debug into the error code? Do you have a stack trace?

Leave a Comment