FAQ
I'm using PHP 4.3.7 on Redhat 2.1ES against an Oracle 8.1.7
database.Using the PHP OCI interface I have an application that opens a
persistent connection and runs a main select to get a list of Items,
then while looping through the results it then runs a function against
these items In which it runs several nested selects (It's a bill of
materials explosion), It can be upto 4 or
5 nested selects deep. If I run the selects with an OCI_DEFAULT method
(not commiting on success) the program will run and at certain points
throw a segmentation fault. Usually I don't commit at all when I only
run a select. If however I change the method to commit on success then
it will work fine. Is there a results or transaction buffer maybe I'm
blowing? Does the commit on success free that up?

Thanks
Justin

--
Justin Bennett
Network Administrator
Dynabrade, Inc.
8989 Sheridan Dr.
Clarence, NY 14031

--
http://www.freelists.org/webpage/oracle-l

Search Discussions

  • Mladen Gogala at Jul 14, 2005 at 2:09 pm

    Justin Bennett wrote:

    I'm using PHP 4.3.7 on Redhat 2.1ES against an Oracle 8.1.7
    database.Using the PHP OCI interface I have an application that opens a
    persistent connection and runs a main select to get a list of Items,
    then while looping through the results it then runs a function against
    these items In which it runs several nested selects (It's a bill of
    materials explosion), It can be upto 4 or
    5 nested selects deep. If I run the selects with an OCI_DEFAULT method
    (not commiting on success) the program will run and at certain points
    throw a segmentation fault. Usually I don't commit at all when I only
    run a select. If however I change the method to commit on success then
    it will work fine. Is there a results or transaction buffer maybe I'm
    blowing? Does the commit on success free that up?
    Justin, the problem is in persistent connection. If you use new
    connection, it will work. Persistent connection
    will attempt to reuse session, if it exists, but it doesn't work as
    advertised unless you have an application server
    which can maintain persistent connections. My advice is to swith to PHP5
    (much, much more powerful then PHP4)
    and use oci_new_connect instead of ocilogon or oci_pconnect.

    --
    Mladen Gogala
    Oracle DBA
    Ext. 121

    --
    http://www.freelists.org/webpage/oracle-l
  • Justin Bennett at Jul 14, 2005 at 2:23 pm
    I just do an OCILogon, and reuse the identifier for each sql statement.
    If I used a different handle for each select it would work ok is that
    the gist?

    right now

    $c=OCILogon("user", "pass", "$db");

    I could do:

    $c=OCILogon("user", "pass", "$db");
    $d=OCILogon("user", "pass", "$db");
    $e=OCILogon("user", "pass", "$db");
    $f=OCILogon("user", "pass", "$db");

    and use a seperate connection for each sql block?

    Whats the cause of the segmentation fault, too much buffering on a
    connection something without doing a commit?

    We'll probably goto php 5 but I have a lot of programs written that
    would need to be tested or changed before we cutover to 5. Can I take a
    php 4 program and run it on PHP5 with OCI without too much of a problem?

    Justin Bennett
    Network Administrator
    Dynabrade, Inc.
    8989 Sheridan Dr.
    Clarence, NY 14031

    On 7/14/2005 3:11 PM, Mladen Gogala wrote:

    Justin Bennett wrote:
    I'm using PHP 4.3.7 on Redhat 2.1ES against an Oracle 8.1.7
    database.Using the PHP OCI interface I have an application that opens a
    persistent connection and runs a main select to get a list of Items,
    then while looping through the results it then runs a function against
    these items In which it runs several nested selects (It's a bill of
    materials explosion), It can be upto 4 or
    5 nested selects deep. If I run the selects with an OCI_DEFAULT method
    (not commiting on success) the program will run and at certain points
    throw a segmentation fault. Usually I don't commit at all when I only
    run a select. If however I change the method to commit on success then
    it will work fine. Is there a results or transaction buffer maybe I'm
    blowing? Does the commit on success free that up?
    Justin, the problem is in persistent connection. If you use new
    connection, it will work. Persistent connection
    will attempt to reuse session, if it exists, but it doesn't work as
    advertised unless you have an application server
    which can maintain persistent connections. My advice is to swith to
    PHP5 (much, much more powerful then PHP4)
    and use oci_new_connect instead of ocilogon or oci_pconnect.
    --
    http://www.freelists.org/webpage/oracle-l

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouporacle-l @
categoriesoracle
postedJul 14, '05 at 1:32p
activeJul 14, '05 at 2:23p
posts3
users2
websiteoracle.com

2 users in discussion

Justin Bennett: 2 posts Mladen Gogala: 1 post

People

Translate

site design / logo © 2022 Grokbase