Hi,

Mark Hennessy wrote:
> I have decided to use MAX(tablename_index)+1 in advance of inserting the
> record, as I want to use as little dbms-specific magic as possible and
> this matches as close as I can figure the behavior of _seq in mSQL.
> 
> I would be doing the following in the same thread in this order:
> $id=SELECT MAX(tablename_index)+1;
> INSERT into tablename VALUES($id,...);
> 
> Would it be prudent to wrap a rw lock around this?

Yes.
Unless you are 100% sure that you will never have 2 threads doing it at 
the same time ;)

> 
> --
>  Mark P. Hennessy                                           [EMAIL PROTECTED]
> 


Regards
-- 
Joseph Bueno


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to