Search code examples
c#acidtxf

Transactional NTFS (TxF) on Process.Start()


Consider the following code:

try
{
    using(TransactionScope)
    {
       Process.Start("SQLInstaller.EXE");
       throw new Exception();
       Commit();
    }
}
catch(Exception ex)
{
//Do something here
}

Will the changes made by SQLInstaller.exe be rollback in this scenario? More specifically, will the changes made by an external process launched through Process.Start() be handled by TxF?

Thanks!


Solution

  • The starting process will not automagically do its work with transactions.

    This is really a question of whether the model is implicit or explicit. We chose an explicit model specifically because an implicit model is extremely hard to reason about. Consider, for example, what it would be like if the created process went off and made an RPC call that didn't pipe the transaction through: would RPC client and server have consistent views of the world?

    Short answer: nope.