Hello,

I am not sure if this is a bug but I have used DBI and DBD::Oracle
for a long time without any probllem and I am almost certain that
something might be wrong.  Both modules are awesome and this is the
first time that I have ever seen any unexpected behavior.  The issue:

1) if I set $dbh->{LongReadLen} = 1000;
2) then I do my $sth = $dbh->prepare_cached('SELECT my_clob FROM table');
...
3) then after a while I change $dbh->{LongReadLen} = 5000;
4) and then I call the same old statement
   my $sth = $dbh->prepare_cached('SELECT my_clob FROM table');

Sometimes the $sth I get back was not prepared with the new 5000 LongReadLen
but the old 1000 LongReadLen.  It checked out because after doing step 4
I looked at $sth->{LongReadLen} and it was equal to 1000.  Its like the
prepare_cached is not inheriting the \%attr it needs for the $sth from the
$dbh.  If I turn all of the above "prepare_cached" into "prepare" everything
works fine.  I first noticed this error because I was selecting CLOB data
out of a table and I was dynamically calculating the LongReadLen and then
I would get a DBI error that my LongReadLen was too short (I have
LongTruncOk off because I don't want truncation); then I discovered the
problem above.  From the documentation it says that prepare_cached will
return the old cached $sth if the SQL statement and \%attr are exactly the
same.  Is there a bug with prepare_cached not inheriting \%attr from
the $dbh to the $sth?

thank you for your help,
Leandro

--
Leandro C. Hermida
Bioinformatics Database Developer

Biozentrum & SIB
University of Basel
50-70 Klingelbergstrasse
CH-4056 Basel, Switzerland
(W) +41 61 267 1579



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Reply via email to