Home All Groups Group Topic Archive Search About

How to use TransactionScope to roll back changes except for one ta

Author
8 Mar 2006 4:23 PM
BF
I need to roll back database activities from Business Object level. I need to
roll back changes in all other tables except ProcessError table where I
logged my process errors.

I need to do this business object level transactions in many places and the
application structure is very complicate. So I don't have much way to know
what tables or databases I am updating from the business object layer. I just
want to roll back database changes except for ProcessError table.

Can TransactionScope help me to for this?

Thanks a lot.

Author
8 Mar 2006 7:11 PM
Sahil Malik [MVP C#]
Open a new connection inside the TransactionScope and append "enlist=false"
on it's connection string - write into the ProcessError table using that
connection.

Obviously you will be using a brand new connection pool - but thats about
the only downside to making this work.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
----------------------------------------------------------------------------


Show quote
"BF" <B*@discussions.microsoft.com> wrote in message
news:C88B2787-71B8-4E48-B3EE-26C417245142@microsoft.com...
>I need to roll back database activities from Business Object level. I need
>to
> roll back changes in all other tables except ProcessError table where I
> logged my process errors.
>
> I need to do this business object level transactions in many places and
> the
> application structure is very complicate. So I don't have much way to know
> what tables or databases I am updating from the business object layer. I
> just
> want to roll back database changes except for ProcessError table.
>
> Can TransactionScope help me to for this?
>
> Thanks a lot.
>

AddThis Social Bookmark Button