Nested TransactionScope
Posted: Wed 30 Sep 2015 18:41
Hi,
We're having an issue with transactions and TransactionScope.
Basically we're using the repository pattern and there are certain processes which mean that different repository calls and chained one after the other to and we want those to happen atomically. The repository calls also need to be available separately and each of our add/update methods will always run at least 2 DB sproc calls as we have an auditing framework implemented within them.
To keep the layers separated we want to avoid bubbling the MySQL Connection/Transaction all the way into the Business Logic Layer, we would prefer to use the inbuilt TransactionScope but this doesn't appear to work with this connector as all the db calls need to happen within the same connection.
We did create our own simple Transaction helper which was OK but now we have these nested transactions to deal with it is not working as it should.
Is there a way of using TransactionScope with dotConnect? Can these be nested? Has anyone had an similar experience in this or can shed any light on alternative solutions?
We're having an issue with transactions and TransactionScope.
Basically we're using the repository pattern and there are certain processes which mean that different repository calls and chained one after the other to and we want those to happen atomically. The repository calls also need to be available separately and each of our add/update methods will always run at least 2 DB sproc calls as we have an auditing framework implemented within them.
To keep the layers separated we want to avoid bubbling the MySQL Connection/Transaction all the way into the Business Logic Layer, we would prefer to use the inbuilt TransactionScope but this doesn't appear to work with this connector as all the db calls need to happen within the same connection.
We did create our own simple Transaction helper which was OK but now we have these nested transactions to deal with it is not working as it should.
Is there a way of using TransactionScope with dotConnect? Can these be nested? Has anyone had an similar experience in this or can shed any light on alternative solutions?