PHP - Atomicity
Posted: Mon Mar 29, 2010 11:16 am
Hi
I am new to PHP based server side scripting; so this might seem a very strange question.
A typical page on my website will consist of some php based scripting embedded in html tags. Now suppose someone clicks to go to this page, and suddenly the connection breaks, because of either this user pressing the stop button or internet disconnection etc. Then, which of the following three outcomes will ALWAYS result ?
a) The entire PHP code gets executed on the server, since the request has already reached the server, and php is really a server side scripting language. But this also means that unknown to the user, this code might have executed, and this might not be a good thing in scenarios whether suppose user was registering with a website, but does not know whether the registration has completed.
b) Since connection broke, the PHP code does not get executed at all.
c) Some part of the PHP code gets executed, depending upon when the connection broke. (Really undesirable, I suppose)
I tend to believe that (a) is the scenario that will ALWAYS TAKE PLACE, since I believe that might be the advantage of server side scripting.
Any comments ?
TIA
I am new to PHP based server side scripting; so this might seem a very strange question.
A typical page on my website will consist of some php based scripting embedded in html tags. Now suppose someone clicks to go to this page, and suddenly the connection breaks, because of either this user pressing the stop button or internet disconnection etc. Then, which of the following three outcomes will ALWAYS result ?
a) The entire PHP code gets executed on the server, since the request has already reached the server, and php is really a server side scripting language. But this also means that unknown to the user, this code might have executed, and this might not be a good thing in scenarios whether suppose user was registering with a website, but does not know whether the registration has completed.
b) Since connection broke, the PHP code does not get executed at all.
c) Some part of the PHP code gets executed, depending upon when the connection broke. (Really undesirable, I suppose)
I tend to believe that (a) is the scenario that will ALWAYS TAKE PLACE, since I believe that might be the advantage of server side scripting.
Any comments ?
TIA