RE: How to call DBD::Oracle's dbms_output_get from within a DBIx
- From: Philip.Garrett@xxxxxxxxxxx (Philip Garrett)
- Date: Thu, 22 Feb 2007 09:13:15 -0500
Tim Bunce wrote:
On Thu, Feb 22, 2007 at 09:12:14AM +0000, Martin Evans wrote:
Tim Bunce wrote:
On Wed, Feb 21, 2007 at 04:25:54PM +0000, Martin J. Evans wrote:
and I still get
Deep recursion on subroutine "DBD::Oracle::db::dbms_output_get"
dbms_output_get does create a new statement, prepare and execute it
and it appears when execute is called it ends up back in my
DBIx::Log4perl::execute method. I don't understand why this happens
:-(
Ah. Of course. Why would you except it not to happen? ;-)
dbms_output_get calls execute() on a statement handle created from
your subclassed dbh handle. So your DBIx::Log4perl::st::execute will
be called when dbms_output_get calls the execute method.
You need to either use a separate non-DBIx::Log4perl dbh for the
dbms_output_get call, or try something more hackish like
my @d = $dbh->func('dbms_output_get')
unless $sth->{Statement} =~ /^begin dbms_output.get_line/;
A slightly more efficient (maybe less hackish? ;-) way would be to use a
localized package variable as a semaphore:
sub execute {
my ($sth, @args) = @_;
my $ret = $sth->SUPER::execute(@args);
if (!$DBIx::Log4perl::st::DBMS_OUTPUT_GET) {
local $DBIx::Log4perl::st::DBMS_OUTPUT_GET = 1;
my $dbh = $sth->FETCH('Database');
my @d = $dbh->func('dbms_output_get');
}
return $ret;
}
- Philip
.
- Follow-Ups:
- Re: How to call DBD::Oracle's dbms_output_get from within a DBIx
- From: Tim Bunce
- Re: How to call DBD::Oracle's dbms_output_get from within a DBIx
- References:
- Re: How to call DBD::Oracle's dbms_output_get from within a DBIx
- From: Tim Bunce
- Re: How to call DBD::Oracle's dbms_output_get from within a DBIx
- Prev by Date: DBI 1.54 RC8 Windows XP testing results
- Next by Date: DBD::Informix Test Error On 64bit Linux (RHEL4.4)
- Previous by thread: Re: How to call DBD::Oracle's dbms_output_get from within a DBIx
- Next by thread: Re: How to call DBD::Oracle's dbms_output_get from within a DBIx
- Index(es):
Relevant Pages
|
|