0

i have this very simple workflow:
Simple Workflow

As you all can see it consist of a receive a simple assign and a sendresponse, all in a receive transaction scope.

Now on the consumer side i have this simple piece of code:

    static void Main(string[] args)
    {            
        using (TransactionScope scope = new TransactionScope())
        {
            Transaction t = Transaction.Current;
            t.TransactionCompleted += t_TransactionCompleted;

            TransactedServiceRef.ServiceClient cli = new TransactedServiceRef.ServiceClient();
            string aux = cli.GetData(new TransactedServiceRef.GetData() { id = 1, value = 1 });                

            Console.WriteLine(aux);
            scope.Complete();

        }            
        Console.ReadLine();

    }

    static void t_TransactionCompleted(object sender, TransactionEventArgs e)
    {
        //POINT 1
    }

Now to my problem: I don't know why but in "POINT 1" my transaction is always aborted!!! No exceptions are thrown, no errors, no rollbacks no nothing... it's just aborted... can anyone help me?

btw: the status im hoping for in POINT 1 is Commited...

Leonardo
  • 10,737
  • 10
  • 62
  • 155

2 Answers2

1

You din't include any WCF configuration details in your question? Did you also use an appropriate binding and enable transactions?

I did a blog post on the subject some time ago. Hope that helps.

Maurice
  • 27,582
  • 5
  • 49
  • 62
  • i know! i read it! and did everything as you said! The transaction does flow INTO the workflow... seems that it just dosen't flow OUT of it... – Leonardo Feb 04 '13 at 13:27
  • A likely cause of problems is the MSDTC. It plays a vital part and can be a real PITA even on a local machine. Another problem might be an exception that causes the transaction to be aborted. – Maurice Feb 04 '13 at 18:06
  • i already checked for exceptions and nothing so far... the GetData operation does return the expected result... how can I look futher on this MSDTC? – Leonardo Feb 04 '13 at 19:46
0

I had "PersistBeforeSend" checked... so when I unchecked it everything went back to what was expected... i don't know why it worked... it just did...

Leonardo
  • 10,737
  • 10
  • 62
  • 155