rileyt

I have a WF with a CompensatableTransactionScope activity in it. When it finishes, the WF is persisted, and I get the following exception thrown:

System.Workflow.Runtime.Hosting.PersistenceException: The transaction has already been implicitly or explicitly committed or aborted. ---> System.Transactions.TransactionException: The transaction has already been implicitly or explicitly committed or aborted. ---> System.Runtime.InteropServices.COMException (0x8004D00E): The transaction has already been implicitly or explicitly committed or aborted (Exception from HRESULT: 0x8004D00E)

My situation:

WF and database are on different 2003 servers.

MSDTC for remote clients is enabled on both machines.

WWF is RTM version

I setup my PersistenceService like this:

WorkflowPersistenceService persistenceService = new SqlWorkflowPersistenceService(connectionString,true,new TimeSpan(1, 0, 0),new TimeSpan(0, 0, 5));

Thanks for help, I'm stuck.
Riley




Re: Windows Workflow Foundation CompensatableTransactionScope problem: "The transaction has already been implicitly or explicitly committed or aborted"

Jon Flanders

What other activities are inside of your CompensateableTransactionScope




Re: Windows Workflow Foundation CompensatableTransactionScope problem: "The transaction has already been implicitly or explicitly committed or aborted"

rileyt

There are 3 custom activities in it. One of them calls a SQL stored proc. One talks to ADAM. One does a file write. Could the SQL activity be the source of this issue because it is enlisted in the transactonal scope

Riley





Re: Windows Workflow Foundation CompensatableTransactionScope problem: "The transaction has already been implicitly or explicitly committed or aborted"

Jon Flanders

Well - if there is an error - persistence won't happen - because they don't want to persist the state of the workflow in an error condition.




Re: Windows Workflow Foundation CompensatableTransactionScope problem: "The transaction has already been implicitly or explicitly committed or aborted"

rileyt

But in this case, there is no sql error. All activities within the transactional scope are succeeding.

R.





Re: Windows Workflow Foundation CompensatableTransactionScope problem: "The transaction has already been implicitly or explicitly committed or aborted"

Jon Flanders

Are you sure I'd set VS.nET to stop on any exception. Do Ctrl-Alt-E and select to stop on any CLR exception. Also make sure you've turned off "Just My Code" debugging - under Tools - Options - Debugging.




Re: Windows Workflow Foundation CompensatableTransactionScope problem: "The transaction has already been implicitly or explicitly committed or aborted"

Khalid Aggag - MSFT

Can you make sure that none of the activities in the CompensatableTransactionScope rolls back or commits the current ambient transaction Also can you try running your workflow on the same machine as the database just to make sure it isnt a MS-DTC issue.