Re: Re: Getting last record ID created from DB

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

 



Richard Lynch wrote:

> On Mon, March 19, 2007 10:58 pm, markw@xxxxxxxxxxxxxx wrote:
>>> markw@xxxxxxxxxxxxxx wrote:
>>>>> markw@xxxxxxxxxxxxxx wrote:
>>>>>>> On Sat, 2007-03-17 at 12:19 -0400, Mark wrote:
>>> Check the documentation - currval returns the last one *for that
>>> session* - it does not return the last global change.
>>>
>>> http://www.postgresql.org/docs/current/static/functions-sequence.html
>>>
>>> It is perfectly safe to use this.
>>
>> In theory that may be true, but can the application developer make any
>> assumption about the underlying architecture? Might you be familiar
>> with
>> connection pooling? Where multiple threads or processes share a
>> database
>> connection or "session?"
> 
> If the pool breaks the documentation about current session, the pool
> is broken.
> 
> Fix it.
> 
> :-)
> 
> I don't think the "pool" will give you somebody else's ID, for the
> record. It's smart enough to not do that, I *believe*, mostly on
> faith.

I've seen some pretty disturbing behavior in some Oracle connection pooling
software. The problem is that you don't know it is the connection pool
causing the problem until you chase it down.

-- 
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