Monthly Archives: April 2013

System.Transactions.TransactionException: The operation is not valid for the state of the transaction

When running large amounts of data into an MS SQL database via a composite WCF-SQL send port in BizTalk I would eventually get (after about 20mins) the error “System.Transactions.TransactionException: The operation is not valid for the state of the transaction”. Smaller amounts of data ran fine.

The solution was to turn off the transaction in the send port. Of course this means you lose the transactional capabilities but do you really want to lock a table on a live database for 20 mins anyway? It may be good practice to only turn this feature off when you know you are running a long transaction and then turn it back on again when you are finished.

Turn_Off_Transactions_In_Send_Port