Hello, I'm having a difficult time using Apache::Session::Postgres and DBI together.
I can use DBI and Apache::Session::Postgres at the same time if they open separate database connections.
But, Apache(mod_perl) segfaults if I pass the database handle to Apache::Session::Postgres.

Configuration and versions:
Apache 1.3.20
mod_perl 1.26
PostgreSQL 7.1
Apache::Session 1.54
Apache::Session::Postgres 1.01
DBI 1.201

This causes a segmentation fault:

my($dbh) = DBI->connect('dbi:Pg:dbname=dbhere', 'userhere', 'passhere' +, { AutoCommit => 1, RaiseError => 1, }) || die("DBI->connect() failed: $DBI::errstr"); tie(%session, 'Apache::Session::Postgres', undef(), { Handle => $dbh, Commit => 1, });
They work fine separately like this:
my($dbh) = DBI->connect('dbi:Pg:dbname=dbhere', 'userhere', 'passhere' +, { AutoCommit => 1, RaiseError => 1, }) || die("DBI->connect() failed: $DBI::errstr"); tie(%session, 'Apache::Session::Postgres', undef(), { DataSource => 'dbi:Pg:dbname=dbhere', UserName => 'userhere', Password => 'passhere', Commit => 1, });
Here is the second error I get, which I assume happens because of the previous segfault problem:
DBD::Pg::st execute failed: pqReadData() -- read() failed: errno=88 a +t /usr/lib/perl5/site_perl/Apache/Session/Store/DBI.pm line 65. (in cleanup) DBD::Pg::st execute failed: pqReadData() -- read() faile +d: errno=88 at /usr/lib/perl5/site_perl/Apache/Session/Store/DBI.pm l +ine 65.
I know I'm enabling autocommit multiple times, but I've tried every combination of (Auto)Commit, so I don't think that's the problem.
My random guess is that there is some variable or handle sharing problem, something isn't being released, (un)locked, committed, disconnected or whatever :)
But I really have no idea, that's why I'm asking the learned monks of Perl.

I've google'd, checked the mod_perl guide, and a few other places.
If I missed something, an RTFM with a little info about what manual to read would be welcome.
If I left any necessary information out, please let me know.


Thanks in advance,
Staunch


In reply to Trouble with mod_perl, Apache::Session::Postgres, and DBI by staunch

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.