Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / November 2006

Tip: Looking for answers? Try searching our database.

Transactions for File I/O?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cmay - 14 Nov 2006 04:44 GMT
I am wrapping a bunch of DB calls into an MSDTC transaction, using the
.net 2.0 System.Transactions transactionscope.

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?

Just checking...
Jani Järvinen [MVP] - 14 Nov 2006 05:03 GMT
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_star
t_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.

Signature

Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
janij@removethis.dystopia.fi
http://www.saunalahti.fi/janij/

cmay - 14 Nov 2006 17:39 GMT
Thanks Jani.

> Hello,
>
[quoted text clipped - 30 lines]
> janij@removethis.dystopia.fi
> http://www.saunalahti.fi/janij/

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.