in reply to Of Mysql, DBI and PK best practices

Personally, I tend to do two things differently:

Update: As noted by kyle above, however, if this code is executed by multiple users/processes, you could end up with a race condition, such that your inserts might still fail because some other guy just added that record since the time that you selected all the primary keys.

  • Comment on Re: Of Mysql, DBI and PK best practices

Replies are listed 'Best First'.
Re^2: Of Mysql, DBI and PK best practices
by dragonchild (Archbishop) on Apr 17, 2007 at 18:28 UTC
    Not unless you do your work within a transaction.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?