FAQ
Hello!

I'm getting constant troubles with DBD::Oracle and mod_perl.

DBD::Oracle 1.08, DBI 1.19, mod_perl 1.26 on Apache 1.3.20,
SunOS netra 5.8 Generic_108528-09 sun4u sparc SUNW,UltraAX-i2
gcc 2.95.3 20010315 (release)
This is perl, v5.6.1 built for sun4-solaris
# perl -V:usemymalloc
usemymalloc='n';


After some time of work (about hundred of requests), I get

DBD::Oracle::db prepare failed: ORA-03113: end-of-file on communication
channel
(DBD: error possibly near <*> indicator at char 1 in '<*>select slogan_text
from
slogans') at /usr/local/www/lib/SQL.pm line 221.

and all Oracle-using perl programs within Apache stops to work until I
restart Apache.

With two clients fetching a page both at one time, I'm 100% getting this in
less than a minute.

I have read all READMEs I've found around, and I couldn't reproduce this
error by standalone perl scripts.

Any help, anyone?

Alex.

Search Discussions

  • Perrin Harkins at Aug 22, 2001 at 1:05 pm

    After some time of work (about hundred of requests), I get

    DBD::Oracle::db prepare failed: ORA-03113: end-of-file on communication
    channel
    (DBD: error possibly near <*> indicator at char 1 in '<*>select
    slogan_text
    from
    slogans') at /usr/local/www/lib/SQL.pm line 221.

    and all Oracle-using perl programs within Apache stops to work until I
    restart Apache.

    With two clients fetching a page both at one time, I'm 100% getting this in
    less than a minute.
    Are you using Apache::DBI? Are you opening a connection in the parent
    process (in startup.pl or equivalent)?
    - Perrin
  • Alex Povolotsky at Aug 22, 2001 at 1:24 pm

    On Wed, Aug 22, 2001 at 09:07:59AM -0400, Perrin Harkins wrote:
    (DBD: error possibly near <*> indicator at char 1 in '<*>select
    slogan_text
    from
    slogans') at /usr/local/www/lib/SQL.pm line 221.
    Are you using Apache::DBI? Are you opening a connection in the parent
    process (in startup.pl or equivalent)?
    Yes, yes.

    ... whithout it - runs... a little longer.

    Alex.
  • Perrin Harkins at Aug 22, 2001 at 1:40 pm

    Are you using Apache::DBI? Are you opening a connection in the parent
    process (in startup.pl or equivalent)?
    Yes, yes.
    Don't open a connection during startup. If you do, it will be shared when
    Apache forks, and sharing a database handle is bad for the same reasons
    sharig a file handle is. Open a connection in the child process instead.
    You can use connect_on_init() from Apache::DBI if you like.
    - Perrin
  • Alex Povolotsky at Aug 22, 2001 at 2:05 pm

    On Wed, Aug 22, 2001 at 09:42:59AM -0400, Perrin Harkins wrote:
    Are you using Apache::DBI? Are you opening a connection in the parent
    process (in startup.pl or equivalent)?
    Yes, yes.
    Don't open a connection during startup. If you do, it will be shared when
    Apache forks, and sharing a database handle is bad for the same reasons
    sharig a file handle is. Open a connection in the child process instead.
    You can use connect_on_init() from Apache::DBI if you like.
    I misunderstood you. I was using connect_on_init. With or without
    Apache::DBI, it fails

    Alex.
  • Kyle Oppenheim at Aug 23, 2001 at 6:19 pm
    We've seen this happen before. Unfortunately, I don't have a fix for you
    but I here's where we left off our chase...

    1. ORA-03113: end-of-file on communication channel (for unknown reason,
    maybe a network blip?)

    2. We have some code that will catch this error and call DBI->connect again.

    3. Apache::DBI intercepts the connect(), looks in it's hash and sees that it
    already has a connection. It pings the handle, fails, and deletes the entry
    from the hash. That's the last refcount on the dbh, so DESTROY gets called.

    4. The DESTROY method yields a "DBI handle cleared whilst still active"
    warning..

    Issuing rollback() for database handle being DESTROY'd without explicit
    disconnect() at /usr/local/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line
    119.
    DBI handle cleared whilst still active
    at /usr/local/lib/perl5/site_perl/5.6.0/Apache/DBI.pm line 119.
    dbih_clearcom (h 0x82a3934, com 0x84ae49c):
    FLAGS 0x211: COMSET Warn AutoCommit
    TYPE 1
    PARENT undef
    KIDS 0 (0 active)
    IMP_DATA undef in 'DBD::Oracle::dr'

    5. Apache::DBI calls the real DBI->connect. This fails due to a "ORA-12154:
    TNS:could not resolve service name (DBD ERROR: OCIServerAttach)".


    If we run with DBI->trace(2) and $Apache::DBI::Debug = 2, we see "ORA-01041:
    internal error. hostdef extension doesn't exist (DBD ERROR:
    OCITransRollback)" appear in between the ORA-03113 and the ORA-12154 errors.

    We were running Perl 5.6.0, DBI 1.14, Apache::DBI 0.88, DBD::Oracle 1.06,
    and the Oracle 8.06 client against an 8.0.6.3.0 db.

    Make sure you let me know if you figure it out ;-)

    - Kyle
    -----Original Message-----
    From: modperl-return-18898-kyleo=tellme.com@apache.org
    On Behalf Of
    Alex Povolotsky
    Sent: Wednesday, August 22, 2001 4:59 AM
    To: dbi-users@perl.org
    Cc: modperl@apache.org
    Subject: Problem with DBD::Oracle with mod_perl


    Hello!

    I'm getting constant troubles with DBD::Oracle and mod_perl.

    DBD::Oracle 1.08, DBI 1.19, mod_perl 1.26 on Apache 1.3.20,
    SunOS netra 5.8 Generic_108528-09 sun4u sparc SUNW,UltraAX-i2
    gcc 2.95.3 20010315 (release)
    This is perl, v5.6.1 built for sun4-solaris
    # perl -V:usemymalloc
    usemymalloc='n';


    After some time of work (about hundred of requests), I get

    DBD::Oracle::db prepare failed: ORA-03113: end-of-file on communication
    channel
    (DBD: error possibly near <*> indicator at char 1 in '<*>select
    slogan_text
    from
    slogans') at /usr/local/www/lib/SQL.pm line 221.

    and all Oracle-using perl programs within Apache stops to work until I
    restart Apache.

    With two clients fetching a page both at one time, I'm 100%
    getting this in
    less than a minute.

    I have read all READMEs I've found around, and I couldn't reproduce this
    error by standalone perl scripts.

    Any help, anyone?

    Alex.
  • Tim Bunce at Aug 23, 2001 at 9:49 pm

    On Thu, Aug 23, 2001 at 11:19:22AM -0700, Kyle Oppenheim wrote:

    3. Apache::DBI intercepts the connect(), looks in it's hash and sees that it
    already has a connection. It pings the handle, fails, and deletes the entry
    from the hash. That's the last refcount on the dbh, so DESTROY gets called.
    4. The DESTROY method yields a "DBI handle cleared whilst still active" warning..
    Apache::DBI should probably do an explicit eval { $dbh->disconnect } if the ping fails.

    Tim.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedAug 22, '01 at 12:03p
activeAug 23, '01 at 9:49p
posts7
users4
websitedbi.perl.org

People

Translate

site design / logo © 2022 Grokbase