문제

How can I use an ADO.NET Manual Transaction to remove records across two databases (on same server)?

I came across this:

TransactionScope in .NET 1.1

But would still like to use .NET 1.1 Manual Transaction if possible.

도움이 되었습니까?

해결책

Wow, been a while since I've looked at 1.1. An ado.net transaction is associated with a connection so there's not really a good way to do this in 1 manual transaction. I remember writing my own cross database txn management class where an executing command would basically register with it and I would keep track of the txns myself. Kind of my own TransactionScope or unit of work. I would roll back all of them if something erred or commit all of them at the end if a "complete" method was called.

The method in the article seems better other than it will invoke DTC (which is ok as long as you want that). I don't think there's a better way to do this.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top