Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > .Net 2.0 : How to use transaction in a WS ?

Reply
Thread Tools

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

 
 
Steve B.
Guest
Posts: n/a
 
      11-15-2006
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.Requ iresNew)] 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Win2003 SP1 error: "New transaction cannot enlist in the specified transaction coordinator" Vencz Istv?n ASP General 2 05-02-2005 05:53 AM
long time transaction Eitan ASP .Net 3 04-11-2005 03:46 PM
Error in OLEDB Transaction Eitan ASP .Net 4 04-10-2005 02:56 AM
DTS Transformation Error: "Transaction context in use by another session." Axel Dahmen ASP .Net 1 02-07-2005 12:35 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57