marcinmoroz

Hello

This how initiazlization part in most of my states looks like:

1.Start initialization part( nothing going i just want to mark this point, so my question is more clear )

2.Start TransactionScope

a)do one operation on database

b)do another

...etc.

3.End TransactionScope

4.End initialization part( nothing going i just want to mark this point, so my question is more clear )

Fault Handlers are set. Now my question, what is going on if exception occur in transaction scope

Fault handlers are fired, but what next The way i think it should work is:

a)before starting transaction, persist workflow( it is done )

b)start transaction (ok )

c)error occured

d)rollback transaction( ok )

e)load previous state, from last persist point.

So when i next time try to load this workflow initialization part is fired again(i should be at point 2). But that is not what is happening, after rollbackin transaction, instead load from previous perssistence point workflow is persisted WHY

So please someone explain how does it work, and why And what technique do u use to handle exceptions in initiazliation part.



Re: Windows Workflow Foundation WWF StateMachine - initialization

marcinmoroz

Bump!

Once again what you guys ( girls are welcome to answer ofc Wink ) do when you have exception in intiazlization part
of State in StateMachine I would like to catch that exception ( it is done ) and run it again ( don`t know how to do it ).




Re: Windows Workflow Foundation WWF StateMachine - initialization

Angel Azcarraga - MSFT

What you're looking for is an Abort call. If your transaction throws an exception, it rolls back and then passes that exception higher. When the exception is handled, the workflow will continue executing, complete, and persist. If you want to "retry," then you should wrap your transaction scope in fault handlers and a While loop with the desired number of retries.

Thanks,

Angel