mkenney has asked for the wisdom of the Perl Monks concerning the following question:

I have been using Apache::Session with no problems for over a year. I just got updated to 5.8.1 from a HTML::Template CPAN install. I've re-installed Bundle::DBI and Apache::Session. Now I get this message when using Apache::Session:

Can't call method "prepare_cached" on unblessed reference at /usr/local/lib/perl5/site_perl/5.8.1/Apache/Session/Lock/MySQL.pm line 69 during global destruction.

I leave my session information in the MySQL database. I can see where a new record is created as before. It now gets deleted after I try to reload my session. HELP. I know I am missing something. Is there something installed wrong or am I missing something.

The row is:
id=a3be086f16f19f0ad53ca02eaad8d0b7
a_session= a3be086f16f19f0ad53ca02eaad8d0b7 _session_id
t=20031004103654
snmember=30111 (A user id I use)

Stumped and Stupid... Please help :-)
Mark

Replies are listed 'Best First'.
Re: Apache Session problem after update
by perrin (Chancellor) on Oct 04, 2003 at 17:35 UTC
    I just got updated to 5.8.1 from a HTML::Template CPAN install.

    Uh, what are you talking about? HTML::Template does not require 5.8.1, and hasn't had a new release in over a year (being stable and all).

    Can't call method "prepare_cached" on unblessed reference at /usr/local/lib/perl5/site_perl/5.8.1/Apache/Session/Lock/MySQL.pm line 69 during global destruction.

    That means your MySQL connect() statement is failing and you aren't checking the return value or using RaiseError.

      i typed "install HTML::Template" and CPAN started the 5.8.1 upgrade. I know its not required, it just ran it. I've been running Apache:Session with no problem. I have had no problems for 1.5 years with my MySQL connects. You are right, I am not properly error checking, but really what I'm asking is why am I getting errors? It gets an error, every single time. Why is the connect statement failing, it was the only one trying at the time? DBI is connecting fine, it is even adding the row.

      Point me to the correct path, I will follow. Please help...

      Mark
        Hmmm, CPAN usually only tries to upgrade Perl when you attempt to install a module that has a version in the core libraries later than the version on your system. Maybe you were running a really old Perl with no File::Spec? Not sure.

        This version of Perl may have broken binary compatibility with older versions. I'm not certain about that, but if it did you would have to reinstall DBI and DBD::mysql before they will work again. Try that.