You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Grant McLean <Gr...@web.co.nz> on 2003/02/24 13:09:14 UTC

Apache::Session and Postgres

I'm trying to use Apache::Session::Postgres and not having much luck.
When I try to create a new session like this:

  use Apache::Session::Postgres;

  tie %sess, 'Apache::Session::Postgres', undef, {
    Handle => $self->dbh, Commit => 1
  };

I get this error:

  Can't locate object method "get_lock_manager" via package
  "Apache::Session::Postgres"

And indeed, that method does not seem to be defined in any of the modules
which Apache::Session::Postgres inherits from.  I tried defining the method
like this:

  sub get_lock_manager {
      my $self = shift;
      return $self->{lock_manager};
  }

and the error message changed to:

  Can't call method "acquire_read_lock" on an undefined value

So then I tried:

  sub get_lock_manager {
      my $self = shift;
      return(new Apache::Session::Lock::Null $self)
  }

but got:

  Can't locate object method "get_object_store"

I'm wondering if Apache::Session::Postgres is not actively maintained
and has fallen out of sync with the core Apache::Session API.


The reason I selected Apache::Session::Postgres was twofold, I happened
to be using Postgres and whereas Apache::Session::DBI requires a
DataSource + UserName + Password, Apache::Session::Postgres will
accept an open database handle (according to the docs).  Would I be
better off trying to hack that facility into Apache::Session::DBI?
or is there likely to be some good reason why it doesn't support it
already?

Regards
Grant

Re: Apache::Session and Postgres

Posted by Perrin Harkins <pe...@elem.com>.
On Mon, 2003-02-24 at 07:09, Grant McLean wrote:
> I get this error:
> 
>   Can't locate object method "get_lock_manager" via package
>   "Apache::Session::Postgres"
> 
> And indeed, that method does not seem to be defined in any of the modules
> which Apache::Session::Postgres inherits from.

I don't see anything that calls that method anywhere in the
Apache::Session distribution.  Either you have some code doing it, or
you have an old version.  You should be running the 1.54 distribution.

- Perrin