You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ilia Lobsanov <il...@lobsanov.com> on 2000/08/02 18:17:57 UTC

Apache::Session upgrade problems and Inheritance

I just upgraded from Apache::Session 1.03 to 1.52, resulting in breaking all
our dependent code.

The problem is that we use our own package which inherits Apache::Session as
follows:

---
package MPL::NullSession;

use strict;
use vars qw(@ISA $VERSION);

$VERSION = '1.00';
@ISA = qw(Apache::Session::MySQL); # was Apache::Session

use Apache::Session;
use Apache::Session::NullLocker;
use Apache::Session::MySQL; # was Apache::Session::DBIStore

sub get_object_store {
    my $self = shift;

    return new Apache::Session::MySQL $self;
		# was Apache::Session::DBIStore
}

sub get_lock_manager {
    my $self = shift;

    return new Apache::Session::NullLocker $self;
}

# yay
1;
---

We tie using:
tie %session, 'MPL::NullSession', $self->{SESSION_ID}, $dbinfo
-where $dbinfo is a hashref

This no longer works and here's the error message from Apache:

Can't connect(   HASH(0x86e338c)), no database driver specified and DBI_DSN
env var not set at
/usr/lib/perl5/site_perl/5.005/Apache/Session/Lock/MySQL.pm line 36

Any help is appreciated. Please reply to my email address as well.

Thank you.


Re: Apache::Session upgrade problems and Inheritance

Posted by Dave Baker <da...@dsb3.com>.
You may need to add LockDataSource, LockUserName and LockPassword to your
$dbinfo hashref.  This fixed the problem for us when we upgraded to the
later Apache::Session.

Dave


On Wed, Aug 02, 2000 at 12:17:57PM -0400, Ilia Lobsanov wrote:
> I just upgraded from Apache::Session 1.03 to 1.52, resulting in breaking all
> our dependent code.
> 
> The problem is that we use our own package which inherits Apache::Session as
> follows:
> 
> ---
> package MPL::NullSession;
> 
> use strict;
> use vars qw(@ISA $VERSION);
> 
> $VERSION = '1.00';
> @ISA = qw(Apache::Session::MySQL); # was Apache::Session
> 
> use Apache::Session;
> use Apache::Session::NullLocker;
> use Apache::Session::MySQL; # was Apache::Session::DBIStore
> 
> sub get_object_store {
>     my $self = shift;
> 
>     return new Apache::Session::MySQL $self;
> 		# was Apache::Session::DBIStore
> }
> 
> sub get_lock_manager {
>     my $self = shift;
> 
>     return new Apache::Session::NullLocker $self;
> }
> 
> # yay
> 1;
> ---
> 
> We tie using:
> tie %session, 'MPL::NullSession', $self->{SESSION_ID}, $dbinfo
> -where $dbinfo is a hashref
> 
> This no longer works and here's the error message from Apache:
> 
> Can't connect(   HASH(0x86e338c)), no database driver specified and DBI_DSN
> env var not set at
> /usr/lib/perl5/site_perl/5.005/Apache/Session/Lock/MySQL.pm line 36
> 
> Any help is appreciated. Please reply to my email address as well.
> 
> Thank you.
> 

-- 

-  Dave Baker  :  dave@dsb3.com  :  http://dsb3.com/  :  AIM#duirwyrd  -
GPG: 1024D/D7BCA55D / 09CD D148 57DE 711E 6708  B772 0DD4 51D5 D7BC A55D