views:

19

answers:

1

Hi,

Suppose say I am doing a couple of operations.

First a delete and then an insert.

Now, these two operations are done with two different connections (say con1 and con2). Both these connections are enlisted in the same TransactionScope.

Before the delete/insert operations the connections are opened and immediately closed.

So, now if the insert fails, then how is the delete rollbacked since con1 has been closed?

Thanks!

A: 

The underlying database has a transaction log, where all actions associated with particular transaction context are stored. This log is independent of the actual connection to the DB to perform particular action. The rollback is atomic and covers all the actions in the transaction log for this particular transaction.

Franci Penov
Oh. Ok. Thanks mate.