[Bast-commits] r8795 -
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Mon Feb 22 19:16:07 GMT 2010
Author: caelum
Date: 2010-02-22 19:16:07 +0000 (Mon, 22 Feb 2010)
New Revision: 8795
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
Log:
with_deferred_fk_checks for Oracle
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm 2010-02-22 11:15:16 UTC (rev 8794)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm 2010-02-22 19:16:07 UTC (rev 8795)
@@ -326,6 +326,25 @@
return $new_alias;
}
+=head2 with_deferred_fk_checks
+
+Runs a coderef between:
+
+ alter session set constraints = deferred
+ ...
+ alter session set constraints = immediate
+
+to defer FK checks.
+
+=cut
+
+sub with_deferred_fk_checks {
+ my ($self, $sub) = @_;
+ $self->_do_query('alter session set constraints = deferred');
+ $sub->();
+ $self->_do_query('alter session set constraints = immediate');
+}
+
=head1 AUTHOR
See L<DBIx::Class/CONTRIBUTORS>.
More information about the Bast-commits
mailing list