[Dbix-class] Autocommit => 0

Len Jaffe lenjaffe at jaffesystems.com
Mon Nov 26 15:02:48 GMT 2012


On Mon, Nov 26, 2012 at 8:17 AM, Peter Rabbitson <rabbit+dbic at rabbit.us>wro=
te:

> On Mon, Nov 26, 2012 at 04:14:18PM +0400, Dmitry Belyavsky wrote:
> > I prefer to set AutoCommit to 0 because it helps to avoid extra commits
> > during debug just not writing the commit() function, whether I use
> > DBIx::Class or plain DBI.
>
> The same effect can be achieved in a much saner way by wrapping the
> entire debug session in a transaction and killing it right before the
> block's end by throwing an exception or something. What you described is
> a prime example of "erroneous use of AC =3D 0" :)
>

So you're saying leave AutoCommit set, and if we need a multi-statement
transaction, we should explicitly wrap those in a new TX?

L.
-- =

lenjaffe at jaffesystems.com   614-404-4214             www.volunteerable.net
Proprietor: http://www.theycomewithcheese.com/ - An Homage to Fromage
Greenbar <http://www.greenbartraining.org/>: Grubmaster: 2012-2009, Grub
Asst: 2008, Trained: 2007.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20121126/835=
74aba/attachment.htm


More information about the DBIx-Class mailing list