473,405 Members | 2,300 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,405 software developers and data experts.

Web services and transactions

I'm using dotNet 2.0 and VS2005, I would like to have some code call several
webservices that I have written that insert data into a DB (MSSQL 2000)
inside a transaction. So that I can rollback if something goes wrong. Can I
support transactions across webservices on different frontend servers? And
if so how?
I've tried to google for it but haven't found anything yet.

Kind Regards,
Allan Ebdrup
Sep 11 '06 #1
5 6091
found this article:
http://www.codeproject.com/soap/TransactionASPNET.asp
that states:
---
XML Web service methods can only participate in a transaction as the root of
a new transaction. XML Web service methods that call other XML Web service
methods participate in different transactions, as transactions do not flow
across XML Web service methods.
---

I guess I'm out of luck.
Sep 11 '06 #2
Hello Allan,

look at WS-Coordination and WS-Transaction
http://www.xml.com/pub/a/ws/2003/04/...ns.html?page=2
AEfound this article:
AEhttp://www.codeproject.com/soap/TransactionASPNET.asp
AEthat states:
AE---
AEXML Web service methods can only participate in a transaction as the
AEroot of
AEa new transaction. XML Web service methods that call other XML Web
AEservice
AEmethods participate in different transactions, as transactions do
AEnot flow
AEacross XML Web service methods.
AE---
AEI guess I'm out of luck.
AE>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 11 '06 #3
Hello Allan,

Yes, as you've found in the article, XML Webservice naturally does not
support distributed transaction processing. This is due to the loose-couple
between webservice client and server(quite different from other distributed
components such as .net remoting, COM+....).

For your scenario, would you provide us some further background information
of your application(client and server...) and what's the current difficulty
and concerns in the application?

If what you want do is group several webmethod calls into a single
transaction, I think you may consider move the transaction processing from
distributed layer to server-side layer. Here are two possible approaches:

1. Encapsulate all the webmethods into a single webmethod. Thus, we can use
the .net framework's transaction support(System.Transaction namespace in
..net framework 2.0) in that single webmethod to perform transaction
processing in server-side code.

2. Still use separate webmethods to contribute the single transaction
operation, however, instead let the webmethod become a direct unit of the
transaction, we make them a proxy method which will add a record into a
certain transaction queue(defined by ourself). After all those webmethods
has been successfully called, we perform the real transaction process
through another internal method(not expsed as webmethod) to execute all the
transaction operations.

How do you think of the above options? Please feel free to post here if you
have any other ideas or any other information you wonder.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Sep 12 '06 #4

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:nP**************@TK2MSFTNGXA01.phx.gbl...
Hello Allan,
For your scenario, would you provide us some further background
information
of your application(client and server...) and what's the current
difficulty
and concerns in the application?
I'm writing a broker that imports some data into our system and the broker
keeps track of what id's the newly inserted elements get in our system and
then saves these id's whit the externat id of the imported data, I don't
want to introduce foreign id's in my main system everything not directly
related to my system is handled by the broker that has it's own DB.
If what you want do is group several webmethod calls into a single
transaction, I think you may consider move the transaction processing from
distributed layer to server-side layer. Here are two possible approaches:

1. Encapsulate all the webmethods into a single webmethod. Thus, we can
use
the .net framework's transaction support(System.Transaction namespace in
net framework 2.0) in that single webmethod to perform transaction
processing in server-side code.
I've grouped all the inserting done into one webservice, but I still have to
save the id's of the newly inserted stuff with the externat id of the
imported data in the broker, my concern is that this fails for some reason
so that I have some data inserted in my system where I don't know what
external id this correlates to in the broker. I really want to avoid this.
2. Still use separate webmethods to contribute the single transaction
operation, however, instead let the webmethod become a direct unit of the
transaction, we make them a proxy method which will add a record into a
certain transaction queue(defined by ourself). After all those webmethods
has been successfully called, we perform the real transaction process
through another internal method(not expsed as webmethod) to execute all
the
transaction operations.
You mean something like using a global TransactionScope stored in some kind
of static variable or something like that? Shouldn't calls to a webservice
be stateless?
How do you think of the above options? Please feel free to post here if
you
have any other ideas or any other information you wonder.
What about the WS-Coordination and WS-Transaction is there support for this
in dotNet 2.0? And if so where can I find a tutorial on how to use them?

Kind Regards,
Allan Ebdrup
Sep 12 '06 #5
Thanks for your reply,

For your comments in the last message:

You mean something like using a global TransactionScope stored in some kind
of static variable or something like that? Shouldn't calls to a webservice
be stateless?
========================================
Yes, XML Webservice is not designed for complex Transaction based
processing and should be stateless for across multiple webmethods calls.
However, for your scenario, the particular scenario require us to maintain
some state and session identity information, we do not completely exclude
the use of any stateful data storage, such as a global dictionary which
maintain some data associated with a certain sessionID(to identify one of
our Transaction). Of course, we need to add additional code to maintain
such session identity table.


What about the WS-Coordination and WS-Transaction is there support for
this
in dotNet 2.0? And if so where can I find a tutorial on how to use them?
========================================
Though the "WS-Coordination" and "WS-Transaction" specification has been
defined, the current implementation of .net webservice components(ASP.NET
webservice or WSE add-on) hasn't provided implementation of them. As far
as I know, the Windows Communication Foundation in .net framework
3.0(WINFX) has provided many new generation features for interop with
webservice(such as Transactional exchange....). If your application is also
planned to migrate onto the new WINFX framework, you can keep an eye on
this.

#Windows Communication Foundation
http://msdn.microsoft.com/winfx/tech...n/default.aspx
For your current scenario, I think it would be better to use some stateful
data on the server-side to record those associated webmethod calls and
group all the transactional operations together and executed in a global
TransactionScope at server-side.

Just some of my understanding. Please feel free to let me know if there is
anything else we can help.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
Sep 13 '06 #6

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

Similar topics

3
by: Peter | last post by:
If I want to build a web services application (not web application), what is the hardware requirement ? Does anyone have the experience?
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: RJN | last post by:
Hi In my application architecture, the business logic classes talk to the data access classes. The business logic classes might also talk to other business logic classes. The business logic...
18
by: Larry Herbinaux | last post by:
I'm having issues with garbage collection with my long-standing service process. If you could review and point me in the right direction it would be of great help. If there are any helpful...
1
by: the4man | last post by:
Hi all! First, excuse me for my english, I'm not a native. Until now I have used for my enterprise web sites ASP + DLLs + COM+. Why COM+? Because we have two database servers and some...
1
by: Kirk Allen Evans | last post by:
I wanted to let you know about a fantastic webcast series focusing on web services technologies. From ASMX 2.0 to WSE 3.0 to WCF, there are some great sessions that you will want to check out. ...
1
by: Anthony J. Biondo Jr. | last post by:
Hi Everyone: I was wondering if it is common practice to use some sort of messaging (MSMQ, WebSphere MQ) with web services. I understand the need for messaging for insert / update transactions,...
2
by: srinivasan.shanmugapillai | last post by:
Hi, I'm running a VB.NET windows applicatrion that is using the enterprise services transactions. While running this application without enterprise services support, a connection is...
1
by: Data Entry Outsourcing | last post by:
Data Entry plays vital role in every business area. Data Entry is one such aspects of any business that needs to be handled properly for expanding your business. Data Entry is one of the leading...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.