Click here to Skip to main content
15,885,097 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
We have one application which is hosted on 4 different server if support suppose the one web server is down that time what will going to be happen for the user who is going to do transaction on that particular web server?

Can any one explain me the scenario?
Posted
Updated 31-Mar-14 1:06am
v2

1 solution

If your application is hosted on 4 different web servers and you are using network load balancing, the load balancing service can detect that one web server is down and it will not forward any request to that server.

In your case, I think you want to know that what will happen if one server is processing some request and it fails while the request is still under processing. The way to handle such cases will depend upon what you are actually trying to do. For example, suppose you are reducing the number of available items and storing the order details, then I will do these two processes in one stored procedure and use the in-built TRANSACTION functionality of database system.

If the in-built transaction functionality does not work in your case, you can have some custom mechanism. One approach could be:

1. Before starting your transaction (a set of more than one operations), assign some transction id for the process and save it in a database.

2. During all the operations of the transaction, perform the actions in a way that you can undo it if required at some later stage. For example, while updating database records, save the old record in a separate table and associate it with the transaction id by having some column for the transaction id.

3. If all the actions of the transaction are complete i.e. server does not fail during the transaction, then update the transaction entry made in point 1 and then display a message to the user.

4. Now suppose that server fails while transaction is processing i.e. step 3 is not complete. To handle this case, write some code to check the failed transactions and undo the operations. You can execute this cleanup code once a day or when the same user login again etc.


I hope this will help. For a better response, share more details about your requirements and codeproject team will surely help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900