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

Tobias Kremer list at funkreich.de
Fri Sep 5 08:45:31 BST 2008


Quoting Jonathan Rockway <jon at jrock.us>:
> * On Wed, Aug 27 2008, Tobias Kremer wrote:
> > We definitely should! IMHO five queries per request to the database just
> > for the session and flash stuff is inacceptable.
> If your app is really slowed by the number of queries to load
> session/flash, use this:

Hmm .. That wasn't really my point. I was trying to say that it should
theoretically be possible to reduce the database queries from 5 down to 2
without losing any of the functionality just by changing the way the flash DBIC
storage is implemented.

On a side note: I have replaced all my $c->flash calls with a custom method that
stores the flash message in the already existent $c->session hash. I haven't had
a single "duplicate entry" error since that change. So implementing the
suggested change would eliminate the race condition, too. Unfortunately I
haven't had any luck patching the existing DBIC session store to utilize the
session instead of separate "flash:" entries :(

--Tobias



More information about the Catalyst mailing list