Solved

RE : WCF

Posted on 2013-05-20
6
282 Views
Last Modified: 2013-06-09
Hi,

I have one WCF which is called by Client through HTTP protocal. Issue is that when client called the WCF i do some updates in my database and for any reason he has not recieved the response may be due to internet failure. So i would like to rollback the updates happenned in my server.

How can i handle these type of half way communication between two servers. What is the best solution or approach for the same.
0
Comment
Question by:vikalgupta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 11

Assisted Solution

by:lenordiste
lenordiste earned 250 total points
ID: 39183719
I believe you are looking for a transaction mechanism so that if a problem occurs during an operation, changes to your database will not be committed.

There is such an option in WCF, here is a brief introduction:
http://msdn.microsoft.com/en-us/library/ms752261.aspx

hope this helps!
0
 
LVL 16

Accepted Solution

by:
Kalpesh Chhatrala earned 250 total points
ID: 39187641
0
 

Author Comment

by:vikalgupta
ID: 39190289
I have 2 physical separated servers communicated on HTTP and scenario is that client called my web service through HTTP and updates happened on my server but client not received response due to internet failure. In that case how can i rollback?
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 39190323
you can do One simple thing

once your transaction is completed your server send response to Client.

Again Client send one acknowledgement of "Received Response of Transaction".

if you did not get Acknowledgement then you can Rollback your Transaction.
0
 

Author Comment

by:vikalgupta
ID: 39193760
This results in increasing the processing time of my process.

If client internet is down at the time of recieving the first time response, do i need to rollback the transaction on the basis of specific interval of time.
0
 
LVL 11

Expert Comment

by:lenordiste
ID: 39194237
Transactions are the way to go if your workflow involves many different calls and you want to be able to roll back the entire transaction if one of those calls fail. You may also want to look into Reliable Sessions if you wish to guarantee message delivery: http://www.c-sharpcorner.com/uploadfile/afenster/wcf-reliable-messaging/. However this won't allow you to roll back if the client did not get a response, it will only allow you to make sure you processed a call only once.

I think what you need is technically not possible without having the client send an acknowledgment call after receiving a response. If the service gets the acknowledgment it commits the transaction, if not it rolls back after some time interval (similar to what Kalpesh2804 is suggesting).
Think of it this way though, internet communication aside what if the client gets the reponse but the software capturing the response crashes before doing anything with it? Do you still consider the transaction to be complete only because it went through the wire? If not, how could you possibly ensure your client has handled the response appropriately? My point is that in your case you will need an acknowledgment from the client at some point to ensure everything ran smoothly.

That said, do you really need that level of transaction? Let's say your client calls your service to widthdraw money from an account and you send back a withdrawalId of some sort. You could simply allow the client to do the same call again but throw an error indicating the transaction was already processed.

If you give us some more specifics on what you are trying to do we may have a great design solution to give you :-) !
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
reading excel file in .net 2 46
WPF and Powershell button hover change text 5 63
EF5 How do I stop pre-compiled views? 8 54
Disable the weekends on datepicker control 6 51
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question