Quoting Tobias Kremer <[EMAIL PROTECTED]>:

> just wanted to inform you that switching from MyISAM to InnoDB for the
> session table does NOT solve the "duplicate entry" problem when
> using flash() :(

Just out of pure curiosity: Why is it that there are dedicated "flash:<hash>"
entries in the storage for the flash? Wouldn't the session be enough? I mean a
session is always established on the first request (logged-in or not), why not
just use it for the flash data (actually that's how other *cough* PHP
frameworks are doing it)? Something like this in my MyApp.pm seems to work
perfectly:

sub flash_msg {
    my( $c, $value ) = @_;
    if( $value ) {
        $c->session->{ '__flash__' } = $value;
    } else {
        return delete $c->session->{ '__flash__' };
    }
}

This should solve the race-condition and will reduce the queries per request
from FIVE(!) when using the flash mechanism down to 2.

What am I missing? :)

--Tobias

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to