Re: Can a script run twice?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2006-05-24 at 13:45, tedd wrote:
> At 12:38 PM -0400 5/24/06, Robert Cummings wrote:
> >On Wed, 2006-05-24 at 09:44, tedd wrote:
> >-snip-
> >  > Back to the posters problem, which is duplicate dB entries caused by
> >>  double clicking.
> >>
> >>  Apparently the problem isn't solvable by using tokens, sessions,
> >>  locking, and such. So why not just check the dB to see if the current
> >>  record has already been entered? If so, don't do it again.
> >>
> >>  Isn't this a solution? Or is there something here that I'm not 
> >>understanding?
> >
> >No the problem with ajax and sessions is usually scripts not releasing
> >the session as soon as they are done. In which case an ajax request
> >blocks all other requests with the same session. For instance I have
> >ajax requests that hit the webserver for slow feed requests that can
> >take up to 10 seconds. If I didn't manually close out the session, then
> >all other requests with the same session (either from browser or other
> >ajax requests) would block for about 10 seconds.
> >
> >If ajax requests are seeing race conditions related to sessions then it
> >is usually due to a custom session implementation that doesn't perform
> >locking.
> >
> >Cheers,
> >Rob.
> 
> 
> Rob:
> 
> I wasn't addressing ajax. But considering the question has been 
> raised -- the race problem is not limited to, or caused by, sessions 
> and appears to be further complicated by browsers.
>
> Please note the following relevant excerpts taken from the following link:
> 
> http://swik.net/Ajax/Ajax-Development-Gotchas
> 
> Multiple Ajax Requests are not fired in order.

This is NOT a race issue. It's an ordering issue which is a different
problem.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux