I've got a strange problem with Apache::Session, and DBD::Oracle:

[Tue Mar 25 10:01:03 2003] [error] Invoking view: /security/list-users.html
--> DBH LONG READ LEN: 256000 <--
--> STATEMENT LONG READ LEN: 256000 <--
[Tue Mar 25 10:01:05 2003] [error] Error trying to access session:
DBD::Oracle::st fetchrow_arrayref failed: ORA-24345: A Truncation or null
fetch error occurred (DBD ERROR: ORA-01406 error on field 1 of 1, ora_type
8, LongReadLen too small and/or LongTruncOk not set) [for statement ``
                SELECT a_session FROM sessions WHERE id = ? FOR UPDATE''
with params: :p1='eb9d7cb85362e686ed6dacb5bd9caea8']) at
/home/miller/lib/perl5/site_perl/5.6.1/Apache/Session/Store/Oracle.pm line
83.

I looked at the session in question I was tring to fetch, and found that the
length of the session was 8718 bytes.  8718 is a *lot* less than 256000
bytes, so there should not have been an error.

The strange thing is that this error is not consistent.  I can populate the
session with a large set of data, access a few other pages (which in turn
causes the session to be loaded), and then it fails. Or, it can fail on the
next request after loading the session.

You can see by the --> <-- delimited comments above that both the database
handle and statement handle have been set to 256000 bytes.  This only seems
to slightly help the problem, in that the error doesn't occur immediately
after the session load.

Anyone have any ideas?

I'm running perl 5.6.1, with current (stable) versions of Apache::Session,
DBI, and DBD::Oracle.  I'm communicating with Oracle 8.1.7.  I've also
included a trace below showing the error, with the LongReadLen=256000.

Cheers!

   -klm.

    -> FETCH for DBD::Oracle::st (DBI::st=HASH(0x999c810)~0x999a738
'Active')
    .. FETCH DBI::st=HASH(0x999a738) 'Active' = ''
    <- FETCH= '' at /home/miller/lib/perl5/site_perl/5.6.1/i586-linux/DBI.pm
line 1416 via /home/miller/lib/perl5/s\
ite_perl/5.6.1/Apache/Session/Store/Oracle.pm line 71
    -> trace in DBD::_::common for DBD::Oracle::st
(DBI::st=HASH(0x999c810)~0x999a738 10 '/tmp/dbi.trc')
    <- trace= 10 at
/home/miller/lib/perl5/site_perl/5.6.1/Apache/Session/Store/Oracle.pm line
77 via /home/miller/\
lib/perl5/site_perl/5.6.1/Apache/Session.pm line 481
    <- FETCH= 256000 ('LongReadLen' from cache) at
/home/miller/lib/perl5/site_perl/5.6.1/Apache/Session/Store/Orac\
le.pm line 79 via /home/miller/lib/perl5/site_perl/5.6.1/Apache/Session.pm
line 481
    -> STORE for DBD::Oracle::st (DBI::st=HASH(0x999a738)~INNER
'LongReadLen' 256000)
    STORE DBI::st=HASH(0x999a738) 'LongReadLen' => 256000
    <- STORE= 1 at
/home/miller/lib/perl5/site_perl/5.6.1/Apache/Session/Store/Oracle.pm line
80 via /home/miller/l\
ib/perl5/site_perl/5.6.1/Apache/Session.pm line 481
    -> bind_param for DBD::Oracle::st (DBI::st=HASH(0x999c810)~0x999a738 1
'772d2e42c49f776e89906b6f4f30a3c7')
       bind :p1 <== '772d2e42c49f776e89906b6f4f30a3c7' (type 0)
       bind :p1 <== '772d2e42c49f776e89906b6f4f30a3c7' (size 32/33/0, ptype
7, otype 1)
       bind :p1 <== '772d2e42c49f776e89906b6f4f30a3c7' (size 32/32, otype 1,
indp 0, at_exec 1)
       bind :p1 done with ftype 1
    <- bind_param= 1 at
/home/miller/lib/perl5/site_perl/5.6.1/Apache/Session/Store/Oracle.pm line
82 via /home/mil\
ler/lib/perl5/site_perl/5.6.1/Apache/Session.pm line 481
    -> execute for DBD::Oracle::st (DBI::st=HASH(0x999c810)~0x999a738)
    dbd_st_execute SELECT (out0, lob0)...
       in  ':p1' [0,0]: len 32, ind 0
OCIStmtExecute(0x94ab4fc,0x99a1d08,0x94ab724,0,0,(nil),(nil),0)=SUCCESS
OCIAttrGet(0x99a1d08,OCI_HTYPE_STMT,0xbfffed06,(nil),10,0x94ab724)=SUCCESS
    dbd_st_execute SELECT returned (SUCCESS, rpc0, fn4, out0)
    <- execute= '0E0' at
/home/miller/lib/perl5/site_perl/5.6.1/Apache/Session/Store/Oracle.pm line
83 via /home/mi\
ller/lib/perl5/site_perl/5.6.1/Apache/Session.pm line 481
    -> fetchrow_arrayref for DBD::Oracle::st
(DBI::st=HASH(0x999c810)~0x999a738)
    dbd_st_fetch 1 fields...
OCIStmtFetch(0x99a1d08,0x94ab724,1,2,0)=SUCCESS_WITH_INFO
    dbd_st_fetch 1 fields SUCCESS_WITH_INFO
OCIErrorGet(0x94ab724,1,"<NULL>",0xbfffe810,"ORA-24345: A Truncation or null
fetch error occurred
",1024,2)=SUCCESS
    OCIErrorGet after ORA-01406 error on field 1 of 1, ora_type 8,
LongReadLen too small and/or LongTruncOk not set\
 (er1:ok): -1, 24345: ORA-24345: A Truncation or null fetch error occurred

OCIErrorGet(0x94ab724,2,"<NULL>",0xbfffe810,"ORA-24345: A Truncation or null
fetch error occurred
",1024,2)=NO_DATA
        0 (rc=1406):
'BQQDAAAACgoGbWlsbGVyAAAAB3VzZXJfaWQKAU4AAAAUbXVzdF9jaGFuZ2VfcGFzc3dvcmQKAzQ
4
MAAAABJzZXNzaW9uX3ZhbGlkX3RpbWUKCktlbiBNaWxsZXIAAAAJdXNlcl9uYW1lBAMAAAACCgE1
AAAADGFjY2Vzc19sZXZlbAQCAAAAyQoEMDM1MwoEMDQyNwoEMDQ3MAoEMDU3MAoEMDcwMAoEMDcw
NQoEMDcxMgoEMDczMQoEMDczNAoEMTA1MQoEMTA1MgoEMTEyNQoEMTEzMAoEMTE0OAoEMTE1NgoE
MTE2NgoEMTE2OAoEMTE3MQoEMTE5MgoEMTE5NAoEMTE5OAoEMTIwMgoEMTIwNAoEMTIxNgoEMTIx
OAoEMTIyMA...'
    !! ERROR: 24345 'ORA-24345: A Truncation or null fetch error occurred
(DBD ERROR: ORA-01406 error on field 1 of\
 1, ora_type 8, LongReadLen too small and/or LongTruncOk not set)'
    <- fetchrow_arrayref= undef row1 at
/home/miller/lib/perl5/site_perl/5.6.1/Apache/Session/Store/Oracle.pm line \
85 via /home/miller/lib/perl5/site_perl/5.6.1/Apache/Session.pm line 481
    >> FETCH       DISPATCH (DBI::st=HASH(0x999a738) rc2/1 @2 g0 ima404
pid#14891) at /home/miller/lib/perl5/site_p\
erl/5.6.1/Apache/Session/Store/Oracle.pm line 85 via
/home/miller/lib/perl5/site_perl/5.6.1/Apache/Session.pm line \
481
1   -> FETCH for DBD::Oracle::st (DBI::st=HASH(0x999a738)~INNER
'ParamValues')
       error: 24345 'ORA-24345: A Truncation or null fetch error occurred
(DBD ERROR: ORA-01406 error on field 1 of\
 1, ora_type 8, LongReadLen too small and/or LongTruncOk not set)'
1   <- FETCH= HASH(0x9a063b0)1keys at
/home/miller/lib/perl5/site_perl/5.6.1/Apache/Session/Store/Oracle.pm line
85\
 via /home/miller/lib/perl5/site_perl/5.6.1/Apache/Session.pm line 481


-------------------------------------------
Kenneth L. Miller
Consultant, Shetland Software Services Inc.
Office: 403.750.1790
  Cell: 403.680.3785

Reply via email to