On 7/27/07, Jonathan T. Rockway <[EMAIL PROTECTED]> 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

_______________________________________________
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