PDA

View Full Version : Integration with Transactionscope


.ben
08-05-2006, 11:22 AM
Is there, or will there be, support for using the transactionscope instead of applying the [Transaction()] attribute?

public class SomeService
{
public void PerformSomething()
{
using(TransactionScope scope = new TransactionScope())
{
//perform some work in dao1
//perform some work in dao2
//calculate something
scope.Complete();
}
}
}

Mark Pollack
08-05-2006, 06:50 PM
Hi,

Yup, I've been planning on providing that as a means to do programmatic transaction management. If we use a convention to name the transaction manager, the tx scope could look that up when it is instantiated, or we could provide the name of the tx mgr (in addition to other tx metadata in the ctor). I've got docs to write and some sample apps to do before I get to that however.

Cheers,
Mark