Re: Transactions for File I/O?
- From: "cmay" <cmay@xxxxxxxxxxxxxx>
- Date: 14 Nov 2006 09:39:52 -0800
Thanks Jani.
Jani Järvinen [MVP] wrote:
Hello,
Part of the operations I need to do in this transaction include some
writing to the file system (deleting a file / creating a file).
There is no way to rollback changes to the file system correct?
If you need to have transactional support on the file system, then you need
to take a different approach than using DTC. Windows Vista and the future
server operating system version of Vista ("Longhorn") does provide a
technology called Transactional NTFS (TxF), which is using a feature called
The Kernel Transaction Manager (KTM). Currently, there's no managed API
wrapper for these APIs (as far as I know), although you could use P/Invoke
to call these APIs. See here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/KTM/fs/ktm_start_page.asp
My opinion is that if you require real transactions on the file system, then
use KTM on Vista. Of course, that is easily more said than done because you
probably require your application to work on Windows XP, Windows Server
2003, etc. as well. In that case, think about the approach used by many SQL
databases like Microsoft SQL Server, which use an internal log file to
implement transactions even though the operating system doesn't guarantee
that file operations succeed.
Hope this helps.
--
Regards,
Mr. Jani Järvinen
C# MVP
Helsinki, Finland
janij@xxxxxxxxxxxxxxxxxxxxxx
http://www.saunalahti.fi/janij/
.
- References:
- Transactions for File I/O?
- From: cmay
- Re: Transactions for File I/O?
- From: Jani Järvinen [MVP]
- Transactions for File I/O?
- Prev by Date: Re: Accessing value of a Variable in parent from custom control
- Next by Date: Re: UnauthorizedAccessException
- Previous by thread: Re: Transactions for File I/O?
- Next by thread: Re: How to deserialize a SettingsProperty
- Index(es):
Relevant Pages
|