TransactionScope question

S

Steve B.

Hi,

I'm building an application that performs some operations of several kinds :
file copy, IIS web site creation, etc...

Since if one of this operation fails, all others have to be rollbacked, I
started to look at the transactionscope class and IEnlistmentNotification
interface.

How can I know what objects in .Net framework implements such objects ? I
know ADO..net does, but what about DirectoryEntry, File.Copy, etc ?

I implemented manually the File.Copy to support transaction... but what a
pain ! Is there any namespace or class that can do the job for me ?

Thanks in advance,
Steve
 
M

Michael Nemtsev

Hello Steve B.,

I suppose your transacted file copy code looks like this one http://codebetter.com/blogs/sahil.malik/archive/2005/04/28/62604.aspx
:)

The problem u are stublem is an issue in the modern development, because
there are no Resources Managers for the such things like file copy end etc.
The solution for this is the STM - software transacted memory, where we can
operate the set of memory block, like files or arrays, within transations

unfortunatelly there is no standart implementations yet

I suggest u to read this http://weblogs.asp.net/ralfw/archiv...onal-memory-making-multithreading-easier.aspx
to understand the deep of the problem :)

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


S> Hi,
S>
S> I'm building an application that performs some operations of several
S> kinds : file copy, IIS web site creation, etc...
S>
S> Since if one of this operation fails, all others have to be
S> rollbacked, I started to look at the transactionscope class and
S> IEnlistmentNotification interface.
S>
S> How can I know what objects in .Net framework implements such objects
S> ? I know ADO..net does, but what about DirectoryEntry, File.Copy, etc
S> ?
S>
S> I implemented manually the File.Copy to support transaction... but
S> what a pain ! Is there any namespace or class that can do the job for
S> me ?
S>
S> Thanks in advance,
S> Steve
 
S

Steve B.

Mine works with File.Copy, but the idea is the same.
I found tha Vista use KTM for making disk and registry changes
rollbackable... but as my apps runs on W2K3, I can't rely on it (or will it
be available for wxp ?)



Thanks for the link, it seems to be a usefull reading.
 
M

Michael Nemtsev

Hello Steve B.,

Vista KTM is probably the part of the WinFS, what they did is just provide
the resource managers and/or compesators for this, imho

I don't thing that u need rely on KTM, just read the link I gave u and try
to used the 3rd party STM realization or I'd think about implementing compensators,
like we do in COM+ providing the rollback for non-transactable components

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


S> Mine works with File.Copy, but the idea is the same.
S> I found tha Vista use KTM for making disk and registry changes
S> rollbackable... but as my apps runs on W2K3, I can't rely on it (or
S> will it
S> be available for wxp ?)
S> Thanks for the link, it seems to be a usefull reading.
S>
S> S>
Hello Steve B.,

I suppose your transacted file copy code looks like this one
http://codebetter.com/blogs/sahil.malik/archive/2005/04/28/62604.aspx
:)

The problem u are stublem is an issue in the modern development,
because
there are no Resources Managers for the such things like file copy
end
etc.
The solution for this is the STM - software transacted memory, where
we
can operate the set of memory block, like files or arrays, within
transations
unfortunatelly there is no standart implementations yet

I suggest u to read this

http://weblogs.asp.net/ralfw/archive/2007/07/03/software-transactiona
l-memory-making-multithreading-easier.aspx

to understand the deep of the problem :)

---
WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we
miss it, but that it is too low and we reach it" (c) Michelangelo
S> Hi,
S> S> I'm building an application that performs some operations of
several
S> kinds : file copy, IIS web site creation, etc...
S> S> Since if one of this operation fails, all others have to be
S> rollbacked, I started to look at the transactionscope class and
S> IEnlistmentNotification interface.
S> S> How can I know what objects in .Net framework implements such
objects
S> ? I know ADO..net does, but what about DirectoryEntry, File.Copy,
etc
S> ?
S> S> I implemented manually the File.Copy to support transaction...
but
S> what a pain ! Is there any namespace or class that can do the job
for
S> me ?
S> S> Thanks in advance,
S> Stev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top