Solved

RE : WCF

Posted on 2013-05-20
6
286 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
Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

 
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

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

627 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