On Wed, Jul 09, 2008 at 12:01:25PM -0400, Michael Hendricks via RT wrote:
Show quoted text> Wed Jul 09 12:01:23 2008: Request 37564 was acted upon.
> Transaction: Ticket created by MNDRIX
> Queue: DBIx-Class
> Subject: find_or_create race condition
> Broken in: 0.08010
> Severity: Important
> Owner: Nobody
> Requestors: michael@ndrix.org
> Status: new
> Ticket <URL:
http://rt.cpan.org/Ticket/Display.html?id=37564 >
>
>
> Because find_or_create() reads and then writes based on the result, it
> is subject to a race condition. If it can't be avoided by changing the
> implementation, it should probably be mentioned in the documentation to
> help avoid problems.
You're right. Fancy writing up some text we can use?
(note - it -can- be fixed, but somebody would need to figure out how to
parse unique key errors on all supported databases to get it to work, and
nobody's yet volunteered to try it on any database at all, sadly)
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director
http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/