Are you sure that InnoDB would solve this issue? Even if just a row was
locked and you have 2 inserts at the exact same time how would that
resolve the issue? I could see InnoDB solving the issue if updates were
being made to the row but not a insert on a new record. Actually if
anything it makes more sense to me that a table lock would help prevent
issues on new inserts. 

But I am very interested in hearing your explanation as I have seen this
a lot and we use both innodb and MyISAM tables where each makes sense to
use.

Thanks,
------------------------------------------
Ali Mesdaq
Security Researcher II
Websense Security Labs
http://www.WebsenseSecurityLabs.com
------------------------------------------

-----Original Message-----
From: J. Shirley [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 27, 2007 11:38 AM
To: The elegant MVC web framework
Subject: [BULK] - Re: [Catalyst] flash with DBIC session storage

On 7/27/07, Tobias Kremer <[EMAIL PROTECTED]> wrote:
> Am 27.07.2007 um 20:14 schrieb J. Shirley:
> > On 7/27/07, Tobias Kremer <[EMAIL PROTECTED]> wrote:
> >> While hammering my site with ab (Apache bench) I'm getting loads of

> >> the the following error message:
> >> Couldn't render template "undef error -
> >> DBIx::Class::ResultSet::find_or_create(): DBI Exception:
> >> DBD::mysql::st execute failed: Duplicate entry 
> >> 'flash:4f1bddce6c7828c27b2e47265f614109d4c21f19'
> >> for key 1 [for Statement "INSERT INTO sessions (id) VALUES (?)"
> >> with ParamValues: 
> >> 0='flash:4f1bddce6c7828c27b2e47265f614109d4c21f19']
> >> at /usr/local/lib/perl5/site_perl/5.8.8/Catalyst/Plugin/
> >> Session/Store/DBIC/Delegate.pm line 52"
> >
> > What's your backend RDBMS?  Not using MyISAM or something similarly 
> > silly, right?
>
> Indeed, I'm using MySQL + MyISAM but I've never come across this 
> problem before.
>
> Is this some sort of locking issue and I've no choice but switch to 
> InnoDB?
>
> --Tobias
>

MyISAM cannot do row level locking, so the only alternative is table
locking on writes.  So, what happens is you'll have two concurrent write
requests with the same session key and they'll clobber each other.

The session table really really really should be InnoDB.  MyISAM is very
poorly suited for such activities.  As a general rule of thumb, I tend
to always say that unless you know why you should be using MyISAM, you
should use InnoDB.

Good luck with it though :)

-Jay
--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

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

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

Reply via email to