views:

69

answers:

1

Hi I am developing an eshop application. I am using webservice to create Order in Oracle database and websvc will give a response (OrderNumber) and I will inform customer that his Order (OrderNumber) is generated My problem The creation of order is taking too much time in backend system and user is keeping refreshing the page, On each refresh user is coming back to Order create Page, so user is able to click on create Order button again In such cases multiple orders are creating for same orderlines.I can restrict user to create only one order per session in case I got order number in websvc response and I can give ordernumber to customer in next page But real problem come when I didn't get response(Ordernumber) and user is refreshing page. request is already went to Backend system and it will create order and my applicaion will not get response

Is there any method in PHP where we can asyncronously check the status of order if first request is initiated by user and it doesn't matter the furthur page navigation Please help me out.. Thanks in advance

+1  A: 

Hi Renjith,

What you can do here is put a flag in the database for the submit information from the user (for e.g. user-ip-info, submit-status). On load of the page, you can put a check for this flag and depending on it enable/disable the Create Order button.

Let me know if you need more details.

pinaki

pinaki
+1, May be able to set a reference var in SESSION and accomplish the same thing without a query, too .. but basically the same approach.
Tim Post
Yes you are correct.. but I am using Webservice from a middleware application to create Order, this webservice is responsible for Order creation.. so I need to wait for response from webservice.. if I didn't get response and user refreshes the page Order will be created and my application will not get the Order number so it will give option to create order again :(Iwant some thing like php need to make persistant connection to webservice until it get response and page refresh should not affect the persistant connection
Renjith R
You cannot stop page refresh as user can anyway kill the browser and restart. What I suggest is that you let the user refresh the page, but add a check layer in between (using the database or session flag) which stops the refresh from making the webservice request altogether. So until the first request is complete from the given IP, you do not allow another webservice create order. I suppose this should fix your problem. Let me know your thoughts.
pinaki
Pinaki.. thanks for your reply...Yes this is a good option.. but it is not fullfilling my entire requirements.I need to show user the Order Number which is already created in backend systems. Order number is the ony ID that can fetch the information about the order details.
Renjith R