your problem may be the connect_on_init for persistent connections. They
need to be exactly the same for session connections and the connect string
you use for other calls to the same db.  The current version of
Apache::Session::DBIStore passes additional connect paramters when
connecting to the db, specifically is passes the anonymous hash with
{RaiseError => 1, AutoCommit => 1}

Apache::DBI->connect_on_init(
        "dbi:oracle:database=dbname;host=dbhost",
        user,
        password,
        { RaiseError => 1, AutoCommit => 1 }
        ) || die $DBI::errstr;

Sync the two connections in the startup.pl file or create a separate entry
for the session db connection in the manner above if session data is in
whole separate db/host and you should be able to cache the persistent
connection for session requrests.

What's a bit confusing with your problem stated below is that you should
still get cached connections for Apache::Session::DBIStore if you use
Apache::DBI after the first session request and if it's already working for
your other db calls.  Are you sure that you are getting disconnected.  Make
sure you "use" Apache::DBI before you "use" any other DBI,DBD::* modules in
the startup.pl or the httpd.conf file.

sang

-----Original Message-----
From: Igor Chudov @ home [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 28, 2000 5:11 PM
To: Jeffrey W. Baker
Cc: [EMAIL PROTECTED]
Subject: Re: speed up/load balancing of session-based sites


Apache::Session is great, but...

Has anyone else run into this?

I use Apache::Session with DBM files and it works great.

When used with databases, Apache::Session creates (and destroys)
a database connection each time it creates a new session object,
which is basically every request.

When it is used with a database that is *slow* to establish connections,
like Oracle, this puts a tremendous overhead. I had to give up Oracle
storage for sessions for this reason, and use DBM files.

My persistent oracle connections are cached properly with mod_perl and
are no problem.

        - Igor.

Reply via email to