Last post Dec 21, 2006 03:49 AM by Joannes Vermorel
Dec 20, 2006 11:44 AM|Joannes Vermorel|LINK
Currently, the classical website update through FTP is anything but atomic, files get deleted and then re-uploaded one by one. Does anyone knows whether is possible to achieve something that would be a "transactional" deployment? Basically, performing a
batch of file operations as a single atomic transaction.
Any idea on the question?
Thanks in advance,
Lokad.com, business time-series forecasting
transaction atomic ftp
Dec 21, 2006 02:20 AM|pickyh3d|LINK
If you're asking for a tool that does this, then I've never heard of one.
However, there are file systems out there that are transactional (honestly, the only one I know of is ZFS, which is not supported on Windows to my knowledge, kind of making this not an ASP.NET issue unless you look at using Mono on Sun, but I digress), which
may provide this functionality built-in, but the best I can think of off the top of my head for Windows would be to create a copy of the files that you want to overwrite, locally, in a temporary directory (or even just save versioned files, which could be
nice for histories, tracking purposes, and rollbacks), and once that completes error free (you can loop recursively and stop if an Exception is caught--since you're copying, nothing is hurt at this point), you can then delete and overwrite the files one by
one. If an error occurs at this point, you can attempt to rollback by backing up your chain of delete/overwritten files and replace them with those from the temporary directory.
Unfortunately though, if you failed to write a file for anything other than a permissions error or something along those lines, then the copies may fail to overwrite the invalidated files.
Hope that wasn't too confusing.
Dec 21, 2006 03:49 AM|Joannes Vermorel|LINK
Ok, thank you very much for your detailed answer. I may have indeed to wait for WinFS.