.Net 2.0 : How to use transaction in a WS ?

S

Steve B.

Hi,

I've a businness layer with some business objects. In these objects, I use
several TableAdapters to get and update data.
In order to maintain the consistency of data, I'd like to use transaction.

How can I combine both [
WebMethod(TransactionOption=TransactionOption.RequiresNew)] and the
using(TransactionScope) statement ?

By now I've something like this :

The bll :
public void DeleteGroup(int groupID)

{

using (TransactionScope transactionScope = new TransactionScope())

{

DO THE WORK

// If nothing wrong happened, Complete() the transaction

transactionScope.Complete();

}

}



The WS that map the bll:

[WebMethod(

TransactionOption = TransactionOption.Required

)]

public void DeleteGroup(int groupID)

{

gMgr.DeleteGroup(groupID);

}



Will the delete operation will be enlisted in "global" transaction ? Have I
something to do on the proxy object on the client side if I call several WS
proxies ?



Thanks,

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top