[Dbix-class] is it safe use find_or_create in "read committed" transaction level

Bill Crawford billcrawford1970 at gmail.com
Mon Sep 20 10:35:22 GMT 2010


On 20 September 2010 10:43, Peter Rabbitson <rabbit+dbic at rabbit.us> wrote:

> 1) We use a transaction the way we do now - depending on the isolation
...
> 2) We issue the select with a read-lock. This however means that the
...
> 3) We try to create the row first, going in blind. This is a good idea
> in theory, however it has a nasty side effect that it makes the current
> transaction no-longer-commitable. So using transactions in a race-prone
> environment is out as well (the user sees random transactions failing
> for no apparent reason)

Or you could 4) check whether savepoints are supported, use one, try
the insert, and see what happens?



More information about the DBIx-Class mailing list