1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Rep Power
    Hi all, I am having difficulty with inconsistent php-oracle connection.

    At the beginning of each php page, i set the environmental variables(ORA_HOME, ORA_SID, TSN_ADMIN) with putenv(...).
    A connection class is created and used by each components (modulized code),
    The connection class used ora_plogon, ora_open, execute some sqls, execute some different sqls, ora_close, ora_logoff.
    Multiple component are then added to differnt php pages.

    The Linux, Oracle 8i, apache, php 4 beta, sometimes run very clean and fast. However, at times you can see
    the loading bar on Internet Explore moving very slowly, and almost never get a connection, and almost
    always gives a connection timedout message.
    (and I end up having to close the IE and reopen another one, and this does not insure another clean connection either).
    I am not sure if my connection class is using the oracle resource
    wisely. What I mean by this is, that by itself, the connection class is efficient.

    execute some sql query
    execute some different sql query using the same cursor

    However, lots of my pages include 5 or 6 components, each using an instance of the connection class. Is what I am
    doing defeating the purpose of persistent connection? I would appreciate it if you could give me some feedback,
    thank you.

  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Rep Power
    I remeber having this problem either when I started up with PHP / Oracle. But soon it disappeared. It was mainly an issue of errors returned by oracle because of improper DB- Handling & SQL statements.
    The line where you say: some SQL- statements is the key to your Problem. You have to use ora_parse (to make sure only clean and proper statements are executed) and then ora_exec. I guess you are using ora_do, aren't you ?
    Further on I do not know why you put the $ORACLE_HOME and all this stuff in your script. This needs to be in your /etc/profile.local (if you are running SuSE) and not in your source.
    Then I do not know why you always log off. I mean it is a nice feature of you are working your way through large transactions. But, As far as I know PHP automatically logs off when the script exits.
    And then, you cxan think about autocommit(on), just in case you are doing transaction. This will avoid getting locks.

    Joerg Fritsch
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Rep Power
    GoetheJF, thanks for replying. As you have
    suggested, I removed the ora_close & ora_logoff. Currently I am using ora_parse
    before ora_exec, and doing mostly SELECT
    statment, getting data out. However, my
    page still locks up.

    I have tried to shorten the timeout parameter
    on apache, but all that did is give me a
    "page can not be displayed" html page faster.

    My system is Redhat Linux 6.0, Oracle8.1.5(8i), Apache 1.3.12, php 4 final release.

    I don't have intimate knowledge of this
    system combination. I have tried to check the
    configuration for Oracle DB, Oracle Listener,
    Apache conf, and php.ini. I am running out
    of ideas, and it has been several weeks since
    our system has this problem...its driving me

    I would really appreciate if anyone could
    give me suggestions, thank you.

Similar Threads

  1. Oracle 9i and Tomcat connection
    By Tamer80 in forum Oracle Development
    Replies: 2
    Last Post: December 11th, 2004, 01:05 PM
  2. Replies: 2
    Last Post: August 18th, 2004, 11:45 PM
  3. Custom error message for MySQL connection
    By dbr1066 in forum PHP Development
    Replies: 6
    Last Post: February 12th, 2004, 12:25 PM
  4. Creating a connection with a Oracle Database
    By cutovoi in forum Visual Basic Programming
    Replies: 1
    Last Post: January 21st, 2004, 02:15 PM
  5. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 02:14 PM

IMN logo majestic logo threadwatch logo seochat tools logo