RE: [PEAR-DEV] mysql sequence emulation - problem
| From: | Lukas Smith | Date: | Fri, 01 Feb 2002 17:47:33 +0000 |
| Subject: | RE: [PEAR-DEV] mysql sequence emulation - problem | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-4336@lists.php.net to get a copy of this message | ||
Hmmm how widely is "SELECT ... FOR UPDATE" supported?
Anyways for all RDBMS that support it you could do that to briefly lock
the row ...
Best regards,
Lukas Smith
smith@dybnet.de
_______________________________
DybNet Internet Solutions GbR
Alt Moabit 89
10559 Berlin
Germany
Tel. : +49 30 83 22 50 00
Fax : +49 30 83 22 50 07
www.dybnet.de info@dybnet.de
_______________________________
> -----Original Message-----
> From: Brian Abent [mailto:brian@onlineinfo.net]
> Sent: Friday, February 01, 2002 6:30 PM
> To: pear-dev@lists.php.net
> Subject: Re: [PEAR-DEV] mysql sequence emulation - problem
>
> > i was using the mysql sequence emulation a lot of times and i
> > realized, that this extra table " *_seq " makes problems, whenever
> > you i.e. switch a table from using auto_increment to use the
sequence
> > emulation, then you have to set the value in the table *_seq to the
> > proper value by hand
> > or
> > if you update an application to use sequences from now on, you have
> > to watch out, to set the sequence number properly by hand
> >
> > why not simply select the "max" value from the table that the nextId
> > needs to be generated for and let the "nextId" return this "max
value
> > +1" ?
> >
> > what do you think??
> > or was there already a discussion in that, which i missed?
>
> 2 users could possibly get the same ID if user 1 does not insert
before
> the
> next request to nextid()
>
> -brian
>
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, e-mail: pear-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: pear-dev-help@lists.php.net
> To contact the list administrators, e-mail:
php-list-admin@lists.php.net