You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Ivan Ooi <ol...@gmail.com> on 2007/09/13 09:17:30 UTC
Questions on auto incremental column IDENTITY_VAL_LOCAL()
Hi all,
I got one question about auto incremental column and
IDENTITY_VAL_LOCAL().
Let says, I got 3 connections doing insert at the same time on one of the
table with an auto incremental column.
Will Derby able to return correct value back to each client using
IDENTITY_VAL_LOCAL() ?
Thanks
Re: Questions on auto incremental column IDENTITY_VAL_LOCAL()
Posted by Ivan Ooi <ol...@gmail.com>.
I see... Thanks! :-D
On 9/13/07, Knut Anders Hatlen <Kn...@sun.com> wrote:
>
> Ivan Ooi <ol...@gmail.com> writes:
>
> > Hi all,
> >
> > I got one question about auto incremental column and
> > IDENTITY_VAL_LOCAL().
> > Let says, I got 3 connections doing insert at the same time on one of
> the
> > table with an auto incremental column.
> > Will Derby able to return correct value back to each client using
> > IDENTITY_VAL_LOCAL() ?
>
> Yes, Derby will return the correct value to each
> client. IDENTITY_VAL_LOCAL() returns the most recently generated
> identity value in a single-row insert on the same connection, and the
> return value should not be affected by concurrent activity on other
> connections.
>
> For details, see
> http://db.apache.org/derby/docs/10.3/ref/rrefidentityvallocal.html
>
> --
> Knut Anders
>
Re: Questions on auto incremental column IDENTITY_VAL_LOCAL()
Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Ivan Ooi <ol...@gmail.com> writes:
> Hi all,
>
> I got one question about auto incremental column and
> IDENTITY_VAL_LOCAL().
> Let says, I got 3 connections doing insert at the same time on one of the
> table with an auto incremental column.
> Will Derby able to return correct value back to each client using
> IDENTITY_VAL_LOCAL() ?
Yes, Derby will return the correct value to each
client. IDENTITY_VAL_LOCAL() returns the most recently generated
identity value in a single-row insert on the same connection, and the
return value should not be affected by concurrent activity on other
connections.
For details, see
http://db.apache.org/derby/docs/10.3/ref/rrefidentityvallocal.html
--
Knut Anders