The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
HELP: slow, inconsistent php-oracle connection
Discuss HELP: slow, inconsistent php-oracle connection in the PHP Development forum on Dev Shed. HELP: slow, inconsistent php-oracle connection PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

June 1st, 2000, 01:32 PM
|
|
Junior Member
|
|
Join Date: Jun 2000
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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.
ora_plogon
ora_open
execute some sql query
execute some different sql query using the same cursor
ora_close
ora_logoff
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.
Sincerely,
Will
|

June 3rd, 2000, 12:45 PM
|
|
Junior Member
|
|
Join Date: Jun 2000
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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
|

June 8th, 2000, 08:51 AM
|
|
Junior Member
|
|
Join Date: Jun 2000
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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
crazy.
I would really appreciate if anyone could
give me suggestions, thank you.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|