Re: Last inserted id

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: "'Simeo Reig'" <simreig(at)terra(dot)es>, pgsql-odbc(at)postgresql(dot)org
Subject: Re: Last inserted id
Date: 2001-11-13 08:35:47
Message-ID: AA30E7BCCA5C1D4E88A231900F8325C00C7D@dogbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

> -----Original Message-----
> From: Simeo Reig [mailto:simreig(at)terra(dot)es]
> Sent: 12 November 2001 20:43
> To: pgsql-odbc(at)postgresql(dot)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.

Browse pgsql-odbc by date

  From Date Subject
Next Message Jean-Michel POURE 2001-11-13 09:33:08 Re: Last inserted id
Previous Message Ni Kun 2001-11-13 07:31:39 Access 2000 ODBC table links