My project supports nested transactions and thus we have MSDTC service running on web server as well as on database server. The project is working fine. However, we have database mirroring established over database server and thus whenever fail-over happens, site page where, nested transactions are used, throws an error:

The operation is not valid for the state of the transaction.

We have MSTDC service running on mirroring database too. Please suggest what should be done to overcome this problem.

1

There are 1 answers

1
Marc Selis On

In the default DTC setup it is the DTC of the server that initiates the transactions (the web server in your case) that coordinates them. When the first database server goes down, it rollbacks its current transaction and notifies the transaction coordinator of this and that is why you get the error. The webserver cannot commit the transaction because at least one participant has voted for a rollback.

I don't think you can get around that. What your webserver should do is retry the complete transaction. Database calls would than be handled by the mirror server and would succeed.

That is at least my opinion. I'm no authority on distributed transactions, nor on database clusters with automatic failover...