You might want to consider generating ID's independently of an autoincrement column. Take a look at DBIx::Sequence and DBIx::MySQLSequence. Yeah, they're older modules, but you might find some advantages in doing it this way.
Comment on Re: Inserting into mysql and getting inserted id at the same time