I am trying to make sense of the following documentation:
I find the documentation hard to read and understand, in particular it gives a false sense of support for transactions at application level. Let's consider the following SO reference, where poster requested support for File.Move
within a transaction:
As of today, the accepted answer is (truncated):
TxFileManager fileMgr = new TxFileManager();
using (TransactionScope scope1 = new TransactionScope())
{
fileMgr.Copy(srcFileName, destFileName);
scope1.Complete();
}
The first thing that stands out is that the accepted answer slightly modified the original poster request, in that answer changed line:
fileMgr.Move(srcFileName, destFileName);
into:
fileMgr.Copy(srcFileName, destFileName);
The important point being that the underlying system (the actual filesystem) may not provide an atomic File.Move
operation (eg. obviously when crossing file system boundary).
How should I read the above documentation to understand what are the actual requirements when implementing a Resource Manager ? In particular, is it possible to implement a Resource Manager when the underlying system does not offer a true atomic operation (we can take the example of the File.Move
operation accross file system boundaries as an example) ?