Jump to content

Recommended Posts

I need to do various things where my script searches and updates various different tables in a database.

 

Some scripts action quite a lot of tables, and require 10 seconds of processing time approx.

 

If the user stopped the process part way through (clicked another link 5 seconds in etc.), or the server failed - I could have it where let's say only 2 of the 6 tables are updated.

 

Is this normal? Do I know what I am talking about? Is there a way around this?

 

Obviously you would get a corrupt database. Sometimes it is a minor thing - ie a forum post - but sometimes it can be more important (imagine if it was related to somebody's account balance on an online site etc.)

 

Why when the user clicks another link does the script stop processing on the server? Surely it should finish, then when it trys to return its response to the user, it would find the user has gone.

Never had this problem. You could always do a JS and lock the page stating "updating" but ultimately the user has control. And if JS is disabled that would not work.

 

But 10seconds is a long amount of time...is that really needed for 1 user to update something? If so I would re-think your logic, or maybe some of the queries could be incorporated into a CRON job and ran every x minutes to prevent he 10 second reload. You could also make note on the page to not click on anything until it is done processing.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.