[Dbix-class] transaction isolation levels

Stanley Pilton stanley.pilton at gmail.com
Mon May 6 12:35:48 GMT 2013


On Mon, May 6, 2013 at 9:33 AM, Peter Rabbitson <rabbit+dbic at rabbit.us> wrote:
> It is entirely out of the scope of DBIC to handle isolation levels,
> and as you correctly noticed you observe the default isolation level
> upon connection.
>
> All you need to do is get a connection (or several for different levels,
> in case you need them) with the proper on_connect_do [1] magic [2] being
> executed on every (re)connect.
>
> Does this answer your question or did I miss something...?

This is helpful and will be good enough for proceeding with this application.

It does seem strange that there's something that has a meaning at a
per-transaction scope (as well as the wider session scope), and,
instead of it being controllable via txn_do or related methods, it's
necessary to get multiple connections, each with a different setting
for transaction behaviour in its wider, session, scope.

In SQL terms, this is the difference between "SET SESSION
CHARACTERISTICS AS TRANSACTION .... " and "BEGIN TRANSACTION ISOLATION
LEVEL ...".  With DBIC, controlling the latter isn't possible, so it's
necessary to start multiple sessions.

  regards, Stanley.



More information about the DBIx-Class mailing list