[Catalyst] flash - Duplicate entries

Tobias Kremer list at funkreich.de
Wed Sep 26 07:22:11 GMT 2007

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?


More information about the Catalyst mailing list