Revert 2131aa2, cf52a9a and 2aa3f4c
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Informix.pm
index b4a2ea8..e8c123d 100644 (file)
@@ -6,7 +6,6 @@ use base qw/DBIx::Class::Storage::DBI/;
 use mro 'c3';
 
 use Scope::Guard ();
-use Scalar::Util 'weaken';
 use Context::Preserve 'preserve_context';
 use namespace::clean;
 
@@ -67,13 +66,11 @@ sub with_deferred_fk_checks {
 
   $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');
-    });
-    $sub->()
-  } after => sub { $txn_scope_guard->commit };
+  my $sg = Scope::Guard->new(sub {
+    $self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
+  });
+
+  return preserve_context { $sub->() } after => sub { $txn_scope_guard->commit };
 }
 
 =head2 connect_call_datetime_setup