PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 1st, 2000, 01:32 PM
stunted stunted is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 8 stunted User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #2  
Old June 3rd, 2000, 12:45 PM
GoetheJF GoetheJF is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 7 GoetheJF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #3  
Old June 8th, 2000, 08:51 AM
stunted stunted is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 8 stunted User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > HELP: slow, inconsistent php-oracle connection

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap