RE: [PEAR] DB::nextId() question

From: Date: Thu, 14 Nov 2002 14:51:18 +0000
Subject: RE: [PEAR] DB::nextId() question
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2722@lists.php.net to get a copy of this message
> From: Drago Bokal [mailto:drago.bokal@fmf.uni-lj.si] > Sent: Thursday, November 14, 2002 3:27 PM > To: pear-general@lists.php.net > Subject: [PEAR] DB::nextId() question > > Hallo, > > how does/should the DB::nextID() work? Does it return the free next ID > of the sequence AND increase the sequence, or does it just return the ID? > > The latter case seems illogical, as two users could have the same ID, > and simultaneously assume it is free, but only one would really have it > free. > > Whereas with the first case, when the ID is returned, it stays free for > ever, and the user can without problems execute > > INSERT INTO ... (ID,...) values (lastID,...). > > The documentation is not clear about that - it says "returns next free ID", > but is this really guaranteed? > calling next id will increment the sequence and return the incremented sequence value .. this is guranteed to not being send to another caller of nextid for that sequence. Regards, Lukas

« previous php.pear.general (#2722) next »