G
Guest
Hi,
I'm wondering what the official Microsoft recommendation is for handling
TransactionScope transactions when using TableAdapters within a DataSet.
I have a dataset that various areas of my business logic uses, and at a
higher level I'd like to wrap several business functions in a
TransactionScope transaction.
The problem is, each TableAdapter has an InitConnection method generated
that creates a _new_ Connection to the database. If a second connection gets
used within the TransactionScope, the transaction will needlessly be promoted
to a distributed transaction.
My current workaround is to alter the Dataset.Designer.cs generated file
manually to change how Connections are created, but that's somewhat painful
sin ce the file gets regenerated automatically.
Thanks for any advice,
Kirk
I'm wondering what the official Microsoft recommendation is for handling
TransactionScope transactions when using TableAdapters within a DataSet.
I have a dataset that various areas of my business logic uses, and at a
higher level I'd like to wrap several business functions in a
TransactionScope transaction.
The problem is, each TableAdapter has an InitConnection method generated
that creates a _new_ Connection to the database. If a second connection gets
used within the TransactionScope, the transaction will needlessly be promoted
to a distributed transaction.
My current workaround is to alter the Dataset.Designer.cs generated file
manually to change how Connections are created, but that's somewhat painful
sin ce the file gets regenerated automatically.
Thanks for any advice,
Kirk