On Mon, 2004-10-18 at 11:57 +1000, Michael Kraus wrote: > G'day again... > > Actually, I want the PID for neither of the reasons you've said. Rather, > I'm using the PID and the date/time as a unique identifier to a database > row. The main contents of the row could occur more than once in the > table I'm working with - however we want to link this exact row with > rows in other tables in the database. Initially I thought about using > the date/time as an identifier (which I was storing anyway), but > remembered that two instances of the script could be running > concurrently, so decided to incorporate the PID to ensure uniqueness.
Theres still a race condition there. If you want a unique id, use a unique id - an identity field for instance. Rob -- GPG key available at: <http://www.robertcollins.net/keys.txt>.
signature.asc
Description: This is a digitally signed message part
-- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
