Subject: | ORA-22922: nonexistent LOB value (DBD ERROR: OCILobFreeTemporary) |
The following code fails with:
DBD::Oracle::st DESTROY failed: ORA-22922: nonexistent LOB value (DBD
ERROR: OCILobFreeTemporary) [for Statement "BEGIN p_mje(?); END;"].
I'm guessing it is because DBD::Oracle is perhaps not paying attention
to InactiveDestroy but that is just a guess.
use strict;
use warnings;
use DBI;
use Proc::Fork;
use Data::Dumper;
use DBD::Oracle qw(:ora_types);
my $ph = DBI->connect(
"dbi:Oracle:host=xxx;sid=yyy",
"xxx", "xxx");
print "ph InactiveDestroy = $ph->{InactiveDestroy}\n";
eval {
local $ph->{PrintError} = 0;
$ph->do(q/drop table mje/);
$ph->do(q/drop procedure p_mje/);
};
$ph->do(q/create table mje (a clob)/);
$ph->do(<<SQL);
create procedure p_mje(a clob) AS
BEGIN
INSERT INTO mje values(a);
END;
SQL
my $clob = 'x' x 50000;
my $st = $ph->prepare(q/BEGIN p_mje(?); END;/);
$st->bind_param(1, $clob, {ora_type => ORA_CLOB});
$st->execute;
run_fork {
child {
# my $ch = $ph->clone;
$ph->{InactiveDestroy} = 1;
# $ph = undef;
exit 0;
}
parent {
waitpid $_[0], 0;
}
};
This was just an inconvenience but now out code disconnect and
reconnects it is more than that.
Perhaps the following from the Changelog has something to do with it:
Fixed memory leak (not releasing Temp Lob with OCILobFreeTemporary)
when created for a bind from John Scoles
Martin
--
Martin J. Evans
Wetherby, UK