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

Discussion in 'ASP .Net' started by Steve B., Nov 15, 2006.

  1. Steve B.

    Steve B. Guest

    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
    Steve B., Nov 15, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Axel Dahmen
    Replies:
    1
    Views:
    717
    Axel Dahmen
    Feb 7, 2005
  2. Jim Bancroft
    Replies:
    1
    Views:
    1,278
    Famel Lee
    May 12, 2005
  3. Maris Janis Vasilevskis

    DB transaction impossible in ASP.NET ?

    Maris Janis Vasilevskis, Jul 7, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    653
    Ray Booysen
    Jul 7, 2006
  4. RAM
    Replies:
    0
    Views:
    413
  5. Vencz Istv?n
    Replies:
    2
    Views:
    268
Loading...

Share This Page