PHP adodb

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • trpost@gmail.com

    #1

    PHP adodb

    I just started using the php adodb library for my Oracle transactions,
    but am running into a problem when there are 2 simultaneous requests
    going on at the same time.

    The nature of the php app that I created is it runs a large query that
    takes approximately 15 seconds to run and then prints the data out on
    a web page.

    If I open 2 separate browser windows and call the same report at about
    the same time, or while one report is processing, I get the following
    error:

    Warning: Unknown: _oci_close_sess ion: OCISessionEnd: ORA-03127: no new
    operations allowed until the active operation ends in Unknown on line
    0

    When I was doing this same report using php4 and the OCI functions I
    had no problems with this database and concurrent transactions, seems
    to be something with how I am using adodb..

    Here is my code snippet:

    include('./adodb/adodb.inc.php') ;
    $username = "user"; //oracle user
    $password = "password"; //oracle password
    $database = "testdataba se"; //tnsnames database entry

    //Type of connection
    $db = NewADOConnectio n('oci8');

    //Sets the query results to come back as assoc arrays
    $db->SetFetchMode(A DODB_FETCH_ASSO C);

    function InvokeErrorHand ler()
    {
    global $db; ## assume global
    echo $db->ErrorMsg();
    }

    //Make the connection
    $db->Connect($datab ase, $username, $password);
    if (!$db->Connect($datab ase, $username, $password))
    InvokeErrorHand ler();

    $query = "SELECT * FROM table";

    $rs = $db->Execute($query );

    This all seems common, as I have seen many examples using similar
    config and connect info, but I cannot get past the concurrent issue, I
    have tried using PConnect instead of connect, but I still get
    problems.

    Thanks

  • Bart the Bear

    #2
    Re: PHP adodb

    On Tue, 27 Mar 2007 09:11:29 -0700, trpost wrote:
    I just started using the php adodb library for my Oracle transactions,
    but am running into a problem when there are 2 simultaneous requests
    going on at the same time.
    >
    The nature of the php app that I created is it runs a large query that
    takes approximately 15 seconds to run and then prints the data out on a
    web page.
    >
    If I open 2 separate browser windows and call the same report at about
    the same time, or while one report is processing, I get the following
    error:
    >
    Warning: Unknown: _oci_close_sess ion: OCISessionEnd: ORA-03127: no new
    operations allowed until the active operation ends in Unknown on line 0
    >
    When I was doing this same report using php4 and the OCI functions I had
    no problems with this database and concurrent transactions, seems to be
    something with how I am using adodb..
    >
    Here is my code snippet:
    >
    include('./adodb/adodb.inc.php') ;
    $username = "user"; //oracle user
    $password = "password"; //oracle password $database = "testdataba se";
    //tnsnames database entry
    >
    //Type of connection
    $db = NewADOConnectio n('oci8');
    >
    //Sets the query results to come back as assoc arrays
    $db->SetFetchMode(A DODB_FETCH_ASSO C);
    >
    function InvokeErrorHand ler()
    {
    global $db; ## assume global
    echo $db->ErrorMsg();
    }
    >
    //Make the connection
    $db->Connect($datab ase, $username, $password); if
    (!$db->Connect($datab ase, $username, $password)) InvokeErrorHand ler();
    >
    $query = "SELECT * FROM table";
    >
    $rs = $db->Execute($query );
    >
    This all seems common, as I have seen many examples using similar config
    and connect info, but I cannot get past the concurrent issue, I have
    tried using PConnect instead of connect, but I still get problems.
    Is this a Windows installation of Apache? I have no such problem
    with either Linux or Solaris.

    Comment

    • trpost@gmail.com

      #3
      Re: PHP adodb

      I get the same problem on both Windows and Solaris

      Comment

      • trpost@gmail.com

        #4
        Re: PHP adodb

        On Apr 2, 1:38 pm, trp...@gmail.co m wrote:
        I get the same problem on both Windows and Solaris
        Is there anything better than adodb, that supports concurrent
        transactions. I am still getting the following if I call the same
        query at the same time:

        Warning: ocilogon() [function.ocilog on]: OCISessionBegin : ORA-03127:
        no new operations allowed until the active operation ends

        Comment

        • Andy Hassall

          #5
          Re: PHP adodb

          On 27 Mar 2007 09:11:29 -0700, trpost@gmail.co m wrote:
          >Warning: Unknown: _oci_close_sess ion: OCISessionEnd: ORA-03127: no new
          >operations allowed until the active operation ends in Unknown on line
          >0
          What version of PHP and Oracle client?

          Does your table contain LOBs? There seem to be a few bugs that result from
          problems in LOBs that result in this error.



          --
          Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
          http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

          Comment

          • Andy Hassall

            #6
            Re: PHP adodb

            On 2 Apr 2007 14:42:44 -0700, trpost@gmail.co m wrote:
            >On Apr 2, 1:38 pm, trp...@gmail.co m wrote:
            >I get the same problem on both Windows and Solaris
            >
            >Is there anything better than adodb, that supports concurrent
            >transactions . I am still getting the following if I call the same
            >query at the same time:
            >
            >Warning: ocilogon() [function.ocilog on]: OCISessionBegin : ORA-03127:
            >no new operations allowed until the active operation ends
            ADOdb is just a wrapper for the various database extensions, in this case the
            oci8 extension to access Oracle; it won't be responsible for the error, which
            is coming from the database extension level.

            --
            Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
            http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

            Comment

            • trpost@gmail.com

              #7
              Re: PHP adodb

              I am using php version 5.05 and Oracle instantclient_1 0_2 and adodb
              4.96. I was previously using php 4.3.9 and the ora functions, which
              worked fine with the same queries, however with php 5+ I cannot use
              the ora fxns and insead must use the oci fxns which is where I run
              into this problem that I cannot run the same long query at the same
              time. I did some more reading about blocking vs. non-blocking
              queries... Is it possible to switch between the 2 using php/oci? Or
              any other ideas??

              Comment

              • trpost@gmail.com

                #8
                Re: PHP adodb

                Ok, so I upgraded php from 5.0.5 to 5.2.1 and the problem went away,
                but it is not so easy for me to upgrade my other Unix envoronment as
                anything after php 5.0.5 requires me to upgrade mysql as well. So what
                is it about 5.0.5 that is causing this error, and how do I fix it
                without upgrading.


                Comment

                Working...