use mro 'c3';
use Scope::Guard ();
+use Scalar::Util 'weaken';
use Context::Preserve 'preserve_context';
use namespace::clean;
$self->_do_query('SET CONSTRAINTS ALL DEFERRED');
+ weaken($self);
return preserve_context {
my $sg = Scope::Guard->new(sub {
$self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
use base qw/DBIx::Class::Storage::DBI/;
use Scope::Guard ();
+use Scalar::Util 'weaken';
use Context::Preserve 'preserve_context';
use DBIx::Class::Carp;
use Try::Tiny;
$self->_do_query('SET CONSTRAINTS ALL DEFERRED');
+ weaken($self);
return preserve_context {
my $sg = Scope::Guard->new(sub {
$self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');