[Catalyst] Duplicate entries with C::P::Session::Store::DBIC and MySQL

Nigel Metheringham nigel.metheringham at dev.intechnology.co.uk
Tue Jul 29 12:42:19 BST 2008


On 29 Jul 2008, at 12:30, Tobias Kremer wrote:
> The short time window between the find() and create() calls of the
> find_or_create() method indeed is the problem. It sounds like this  
> window
> should be too small to ever happen but in reality it happens very  
> often in our
> (and other's) applications. I can force the problem by hammering  
> reload in my
> browser.


Run the find_or_create within a transaction.  You could even extend
find_or_create to package it within a transaction if you wanted.

	Nigel.
--
[ Nigel Metheringham             Nigel.Metheringham at InTechnology.com ]
[ - Comments in this message are my own and not ITO opinion/policy - ]




More information about the Catalyst mailing list