Re: [PHP] ignore-user-abort and connection-handling
On Thu, August 23, 2007 12:04 pm, Jason Pruim wrote: One of these days someone is going to get sick of hearing from me, but until that day comes I have another question :) I asked on a MySQL list about wether it's better to have 1 database with many tables, or many databases with 1 table for my address list application I'm writing. One of the people there asked me about terminating the TCP connections and ensuring that each PHP script runs to completion to keep the database in good condition. He recommened looking at the ignore-user-abort and connection- handling functions in php... So now the question, Do I have to worry if a user hits the stop button in their browser before the script finishes? Will It corrupt the database or causing undo havoc to my system? This is far past my knowledge, so references to how I would use something like that properly would be greatly appreciated! :) It won't corrupt your data. It could tie up MySQL connections and make your server slower, I suppose. I'm not sure that ignore_user_abort is actually going to help, however... Start reading, I guess. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ignore-user-abort and connection-handling
Hi Everyone :) One of these days someone is going to get sick of hearing from me, but until that day comes I have another question :) I asked on a MySQL list about wether it's better to have 1 database with many tables, or many databases with 1 table for my address list application I'm writing. One of the people there asked me about terminating the TCP connections and ensuring that each PHP script runs to completion to keep the database in good condition. He recommened looking at the ignore-user-abort and connection- handling functions in php... So now the question, Do I have to worry if a user hits the stop button in their browser before the script finishes? Will It corrupt the database or causing undo havoc to my system? This is far past my knowledge, so references to how I would use something like that properly would be greatly appreciated! :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED]
Re: [PHP] ignore-user-abort and connection-handling
Hey Craig, Thanks for the answer, my test data is 935 records and on initial page load, it only takes 2 seconds to load the entire page. So I probably won't worry about it for now. Thanks for the answer! :) On Aug 23, 2007, at 1:30 PM, Craige Leeder wrote: Hi Jason, If you have a lengthy script with several queries throughout it, it is possible you could end up with a scrambled database. However, with short scripts, there is not much of a threat of this. Generally, your scripts will probable execute in 2 seconds (and 2 seconds is lengthy), with an average of 1 second or less. In these cases, by the time the user makes the request to the server, it will take longer than the length of your script execution for the termination request to be sent from the browser to the web server, and then to php. Therefor, php will simply halt returning output(assuming output buffering), but all script execution will be complete. That being said, if you wanted extra peace of mind, you could enable ignore-user-abort. Odds are though, that you will never really need it unless you are writing lengthy scripts that take several seconds to execute. Hope this helps, - Craige On 8/23/07, Jason Pruim [EMAIL PROTECTED] wrote: Hi Everyone :) One of these days someone is going to get sick of hearing from me, but until that day comes I have another question :) I asked on a MySQL list about wether it's better to have 1 database with many tables, or many databases with 1 table for my address list application I'm writing. One of the people there asked me about terminating the TCP connections and ensuring that each PHP script runs to completion to keep the database in good condition. He recommened looking at the ignore-user-abort and connection- handling functions in php... So now the question, Do I have to worry if a user hits the stop button in their browser before the script finishes? Will It corrupt the database or causing undo havoc to my system? This is far past my knowledge, so references to how I would use something like that properly would be greatly appreciated! :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ignore-user-abort and connection-handling
Hi Jason, If you have a lengthy script with several queries throughout it, it is possible you could end up with a scrambled database. However, with short scripts, there is not much of a threat of this. Generally, your scripts will probable execute in 2 seconds (and 2 seconds is lengthy), with an average of 1 second or less. In these cases, by the time the user makes the request to the server, it will take longer than the length of your script execution for the termination request to be sent from the browser to the web server, and then to php. Therefor, php will simply halt returning output(assuming output buffering), but all script execution will be complete. That being said, if you wanted extra peace of mind, you could enable ignore-user-abort. Odds are though, that you will never really need it unless you are writing lengthy scripts that take several seconds to execute. Hope this helps, - Craige On 8/23/07, Jason Pruim [EMAIL PROTECTED] wrote: Hi Everyone :) One of these days someone is going to get sick of hearing from me, but until that day comes I have another question :) I asked on a MySQL list about wether it's better to have 1 database with many tables, or many databases with 1 table for my address list application I'm writing. One of the people there asked me about terminating the TCP connections and ensuring that each PHP script runs to completion to keep the database in good condition. He recommened looking at the ignore-user-abort and connection- handling functions in php... So now the question, Do I have to worry if a user hits the stop button in their browser before the script finishes? Will It corrupt the database or causing undo havoc to my system? This is far past my knowledge, so references to how I would use something like that properly would be greatly appreciated! :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ignore-user-abort and connection-handling
if aborted actions are a worry, then consider using transactions in the database, if the process is interupted at any time, the changes made will all role back to a pre transaction start state. bastien Date: Thu, 23 Aug 2007 13:30:00 -0400 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: Re: [PHP] ignore-user-abort and connection-handling Hi Jason, If you have a lengthy script with several queries throughout it, it is possible you could end up with a scrambled database. However, with short scripts, there is not much of a threat of this. Generally, your scripts will probable execute in 2 seconds (and 2 seconds is lengthy), with an average of 1 second or less. In these cases, by the time the user makes the request to the server, it will take longer than the length of your script execution for the termination request to be sent from the browser to the web server, and then to php. Therefor, php will simply halt returning output(assuming output buffering), but all script execution will be complete. That being said, if you wanted extra peace of mind, you could enable ignore-user-abort. Odds are though, that you will never really need it unless you are writing lengthy scripts that take several seconds to execute. Hope this helps, - Craige On 8/23/07, Jason Pruim wrote: Hi Everyone :) One of these days someone is going to get sick of hearing from me, but until that day comes I have another question :) I asked on a MySQL list about wether it's better to have 1 database with many tables, or many databases with 1 table for my address list application I'm writing. One of the people there asked me about terminating the TCP connections and ensuring that each PHP script runs to completion to keep the database in good condition. He recommened looking at the ignore-user-abort and connection- handling functions in php... So now the question, Do I have to worry if a user hits the stop button in their browser before the script finishes? Will It corrupt the database or causing undo havoc to my system? This is far past my knowledge, so references to how I would use something like that properly would be greatly appreciated! :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vistamkt=en-USform=QBRE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php