[Dbix-class] Correct way to rollback txn_scope_guard

Peter Rabbitson rabbit+dbic at rabbit.us
Tue Jul 23 10:56:32 GMT 2013


On Tue, Jul 23, 2013 at 06:58:56PM +1000, Toby Corkindale wrote:
> Hi,
> What is the correct way to rollback when you're using a
> txn_scope_guard, and it's intentional, and you'd rather avoid getting
> a scary warning message printed to the logs?
> 

There currently is no official way to do that. This is mainly because
codeflow taking advantage of explicit rollbacks is almost invariably a
design mistake.

However in the interest of completeness and for better compatibility 
with suboptimal logic I am willing to accept a patch for an ->inactivate 
method (or for even more completeness an inactive() getter/setter), 
which will set the proper internal state to skip what it needs to skip.

I am not willing to add a ->rollback method to the guard though, for the 
reason stated earlier.

Patches as pull reqs here git at github.com:dbsrgits/dbix-class.git or 
email the list.

Cheers



More information about the DBIx-Class mailing list