0

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 Answers1

0

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...

Marc Selis
  • 833
  • 12
  • 17
  • Thanks Marc. I agree that, at the time of fail over transactions will be rolled back. However my concern is that, after wards when a new transaction is started, it should be completed. For this, I have already kept the DTC services running. But, still I am unable to execute the transaction after fail over. – Mahesh Padekar Jan 27 '14 at 10:47