473,396 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Performing a Transaction in 2 systems

I have the need to perform an atomic operation in two systems, a database and
an ftp site. The process is two step; 1. insert a row into oracle, 2. delete
a file from a remote ftp site. I need to make these steps atomic...either
they both succeed or both fail. Any suggestions on how I create a
transaction that bridges these two steps (systems) using C#?

Thanks in advance!

Nov 17 '05 #1
2 2002
Chris,

The problem here is the FTP site. You will have to write some sort of
transaction management for this. Unfortunately, doing something of this
nature is rather tricky. For example, say you write the file to FTP, but
the database insert fails. Then you have to delete the file on the FTP
site. What if you do the reverse?

All-in-all, unless you have an existing resource manager for the FTP
site (which I doubt), then I would consider another option. There are too
many things to take into account (what if the network fails in the middle?
How can you roll back then? Things of that nature).

If you are really serious about doing this the proper way, I would look
into creating a resource manager for FTPing, and then use COM+ to handle the
transaction.

What would be more helpful was if there was a transaction manager on the
FTP machine you want to delete the file from. That way, you could get a
true distributed transaction.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Chris Fink" <Ch*******@discussions.microsoft.com> wrote in message
news:D5**********************************@microsof t.com...
I have the need to perform an atomic operation in two systems, a database
and
an ftp site. The process is two step; 1. insert a row into oracle, 2.
delete
a file from a remote ftp site. I need to make these steps atomic...either
they both succeed or both fail. Any suggestions on how I create a
transaction that bridges these two steps (systems) using C#?

Thanks in advance!

Nov 17 '05 #2
Chris,

I don't think you can get this opperation atomic, you have to make some kind
of compensation code for it [just like biztalk long running transaction
compensation]. When one of the jobs fail there must be some custom rollback
code who rollsback the other actoins. And to be more sure that the actoins
will succeed you can write code wich checks if the operation will succeed,
if the file excists if the db is available and that kind of things... when
all checks give an ok, the code can preform the actions when one fails the
compensation code will be executed. At a gotodtnet workspace I've put some
code wich preforms that same steps to deploy and configurate a biztalk
solution... have a look.
http://www.gotdotnet.com/Workspaces/...a-9d13acfccc0a

greets Clemens
"Chris Fink" <Ch*******@discussions.microsoft.com> wrote in message
news:D5**********************************@microsof t.com...
I have the need to perform an atomic operation in two systems, a database
and
an ftp site. The process is two step; 1. insert a row into oracle, 2.
delete
a file from a remote ftp site. I need to make these steps atomic...either
they both succeed or both fail. Any suggestions on how I create a
transaction that bridges these two steps (systems) using C#?

Thanks in advance!

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Evelyn Pabón | last post by:
Hi I created a database application for the company I'm working and as part of the CFR Part 11 it is a requirement for al the application that are for manufacturing us to have some security...
1
by: Avanish Pandey | last post by:
Hello All We have 3 differen services (in 3 different server) Service A,B,C . We want to implement distributed transaction when call methods of B and C from A. Is it possible? if yes then how? ...
0
by: Raja | last post by:
I have a Linked Server i.e. my SQL Server 2000 is Linked to the Oracle Database. The Link is perfect and dont have any problems in accessing the data from SQL Server 2000. The only problem i am...
5
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by...
6
by: Chris Fink | last post by:
I have the need to perform an atomic operation in two systems, a database and an ftp site. The process is two step; 1. insert a row into oracle, 2. delete a file from a remote ftp site. I need to...
2
by: msnews.microsoft.com | last post by:
Hello, I have the scenario. I m building an application either in asp.net or window application. This application is base on n-tier application model. Let us take example of Northwind Database in...
3
by: Eitan | last post by:
Hello, I have run a long transaction on the DB (sql server) For some long transaction I have got the following message : What can I do in order to run it properly ? Error Type:
2
by: Christian Stooker | last post by:
Part one: ====== Hi ! I want to use SQLite database like the FireBird database: with big isolation level. What's that meaning ? I have an application that periodically check some input...
2
by: Habib | last post by:
CREATE PROCEDURE SimpleInsert ( @custname custname_type, @carname carname_type) AS BEGIN TRANSACTION INSERT Customers (CustName) VALUES (@custname)
2
by: rbg | last post by:
Hi, On My local SQL server I have added a linked server to another SQL server (remoteserver) in another Windows NT Domain. When I run this code select count(*) from...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.