|
Posted by Chris Hope on 01/26/06 23:49
Andy Hassall wrote:
> On Fri, 27 Jan 2006 10:06:58 +1300, Chris Hope
> <blackhole@electrictoolbox.com> wrote:
>
>>> mysql_insert_id() is connection specific, and MySQL connections
>>> aren't shared
>>> between concurrent PHP requests, so this avoids the condition you
>>> describe.
>>
>>What about if persistant connections are used? I'm a little unclear of
>>this myself. Does each PHP thread use a different persistant
>>connection, or can the share them? I would assume the former.
>
> In multiprocess webservers, e.g. Apache 1.3, it's simple - there's a
> completely separate instance of PHP per Apache worker process, each
> with its own persistent connection pool, which will have zero or one
> connection for a given database and credentials. So, there's nothing
> else that can use the connection, since this instance of PHP can only
> run one script at a time.
That's pretty much what I thought. Thanks for the clarification.
[snip]
--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Navigation:
[Reply to this message]
|