Insert multiple child objects fails with DTC error

Insert multiple child objects fails with DTC error

Old forum URL: forums.lhotka.net/forums/t/2485.aspx


awsisme posted on Wednesday, March 07, 2007

I've got a child collection inside a root object. I can add a single new child item to the collection, save it and everything works fine. As soon as I add two items, then save, I get a DTC error. It appears to be transaction related and throws an exception on the cn.open() the second time it's called. As soon as I remove the [Transactional(TransactionalTypes.TransactionScope)]  from DataPortal_Insert everything works fine. 

I'm sure I'm screwing something up with the transactions but can't figure out what. Any help would be appreciated.

 

Andy

ajj3085 replied on Wednesday, March 07, 2007

Only use one connection if you're using TS.  Opening more than one connection, even with the same connection string, will promote the transaction to a distributed transaction.

ajj3085 replied on Wednesday, March 07, 2007

I've added this to the FAQ.

awsisme replied on Wednesday, March 07, 2007

Thank you. I had read your similar response to an earlier post but didn't think it was the same problem. Having one of those failure to connect the dots kind of days.

 

Thanks again.

Copyright (c) Marimer LLC