From: Peter Rabbitson Date: Wed, 13 Jul 2011 07:58:49 +0000 (+0200) Subject: Stop leaking cursors on oracle sequence retrieval X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e6f3272be85d0135c51fb0a3c3bc429f5c3b41f0;p=dbsrgits%2FDBIx-Class-Historic.git Stop leaking cursors on oracle sequence retrieval --- diff --git a/Changes b/Changes index 53622ed..3d79078 100644 --- a/Changes +++ b/Changes @@ -30,6 +30,7 @@ Revision history for DBIx::Class SQL_INTEGER, resulting in silent conversion to '-1' - Fix pre 5.10 failures of t/55namespaces_cleaned.t due to buggy require() (RT#68814) + - Oracle autoinc inserts no longer leave open cursors behind 0.08192 2011-05-10 04:20 (UTC) * Fixes diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index 961b447..81dbeed 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -258,8 +258,12 @@ sub _sequence_fetch { my ( $self, $type, $seq ) = @_; # use the maker to leverage quoting settings - my $sql_maker = $self->sql_maker; - my ($id) = $self->_get_dbh->selectrow_array ($sql_maker->select('DUAL', [ ref $seq ? \"$$seq.$type" : "$seq.$type" ] ) ); + my $sth = $self->_dbh->prepare_cached( + $self->sql_maker->select('DUAL', [ ref $seq ? \"$$seq.$type" : "$seq.$type" ] ) + ); + $sth->execute; + my ($id) = $sth->fetchrow_array; + $sth->finish; return $id; }