Re: Last inserted id

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: Last inserted id
Дата
Msg-id AA30E7BCCA5C1D4E88A231900F8325C00C7D@dogbert.vale-housing.co.uk
обсуждение исходный текст
Ответ на Last inserted id  ("Simeo Reig" <simreig@terra.es>)
Список pgsql-odbc

> -----Original Message-----
> From: Simeo Reig [mailto:simreig@terra.es]
> Sent: 12 November 2001 20:43
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Last inserted id
>
>
> > False.  Option B is multi-user safe, period.  The reason is that
> > currval returns the value last obtained by nextval *in your own
> > session*, independently of what anyone else has done meanwhile.
>
> What do you understand for *session* ? Same postgres
> connection ? Same ADO connection ? (ADO sometimes make more
> than one connection for recordset)
>
> How Can I know how many connections are active ?
> (for ADO debugging)

I don't think you can easily find out what connections are open (at least
from the ADO end). In pgAdmin II there is a long running bug that I can't
resolve that prevents dropping a database because I can't persuade *all*
connections to the specified database to close.

It's for this reason that I'd still use option A - option B may be multi
user safe (now that I understand it properly :-) ) but you never know  how
ADO is going to handle it. In theory it should only use one connection but
the bug I mention above (knowing the time, effort and experimentation I've
put into fixing it) makes me wonder.

Regards, Dave.

В списке pgsql-odbc по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Last inserted id
Следующее
От: Jean-Michel POURE
Дата:
Сообщение: Re: Last inserted id