[Catalyst] flash - Duplicate entries

jason konrad konradjg at gmail.com
Wed Sep 26 16:58:12 GMT 2007


Had this problem, yes.  Solved it, no.  Accepted it, yes.

I have wrapped evals around all the calls to find_or_create in my  
code and catch that error.  I still have issues with the flash (and  
session) with find_or_create.  THis may just be coincidence but in  
the error emails I generate, Internet Explorer is responsible for all  
of these errors. Go figure.


On Sep 25, 2007, at 11:22 PM, Tobias Kremer wrote:

> Quoting Ian Docherty <catalyst at iandocherty.com>:
>> Did I not see something on here, or on DBIx-class list some time  
>> ago to
>> the effect that in find_or_create there is a short window where  
>> having
>> found that a record does not exist it then creates it. I presume that
>> two threads could each detect that a record does not exist and  
>> then one
>> of them would create this error.
>
> Hmm .. That would explain the other issue I'm facing: An  
> update_or_create
> command that once in a while fails with a duplicate entry error.  
> The two
> threads you're mentioning would have to come from the same user at the
> same time though to cause this problem assuming that no two users have
> identical session keys ...
>
>> Reversing the order (try a create first, catch the error, then do  
>> a find
>> if the create fails) was ISTR the proposed answer.
>> But this may not help you if the problem is in the
>> Session/Store/DBIC/Delegate plugin.
>
> Right :( Is this a problem that only affects the MySQL backend  
> because the
> other storage types (memcached, mmap, etc) do not check the uniqueness
> of the session key?
>
> Has nobody else met this problem yet?
>
> --Tobias
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/ 
> catalyst at lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/




More information about the Catalyst mailing list