[BULK] - Re: [Catalyst] flash with DBIC session storage

Perrin Harkins perrin at elem.com
Mon Jul 30 16:13:54 GMT 2007


On 7/27/07, Jonathan T. Rockway <jon at jrock.us> wrote:
> On Fri, Jul 27, 2007 at 11:57:01AM -0700, Mesdaq, Ali wrote:
> > 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?
>
> One transaction would succeed and the other would fail.  If you want
> different behavior, you'll have to change the isolation level (or
> actualy, in this case, rethink your app).

In custom database code this is true, but usually session APIs handle
this kind of thing for you.  They typically provide exclusive locking
while a session is being used, through "SELECT...FOR UPDATE" or
similar.  Even a session module that explicitly doesn't provide
exclusive locking should be able to avoid doing a duplicate insert.

- Perrin



More information about the Catalyst mailing list