Home > Archive > PHP DB > March 2005 > RE: [PHP-DB] database connection timeout
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
RE: [PHP-DB] database connection timeout
|
|
| Jos Juffermans 2005-03-24, 3:56 pm |
| Hi,
Martin Norland wrote:
MN> I'm afraid phrasing a question multiple ways over a course of days tends
MN> not to have much success. In an effort to avoid populating google with
MN> just the question, I will give to you what I would try.
I understand your point but since I wasn't getting any response and never
received a confirmation email from the system telling me that my email
account had been verified, I wasn't sure that the original post was actually
sent to the community. Oddly enough I got an email from the system this
morning asking me to verify my email address - again :s
Anyway, at least this time it triggered a response ;)
MN> Is it that it's not always available, or that it needs time to 'come
MN> back up'. You may want to try running some random low-traffic
MN> application over it to make sure it remains running. Some simple SNMP
MN> protocol or even simpler just connect to a remote GKrellM. Heck, a ssh
MN> connection with top running would do - just something that is constantly
MN> transmitting a trickle of data.
The VPN connection is not always available. I'm afraid I don't have much
control over the VPN myself and I believe only the Oracle port has been
opened in this VPN.
MN> Essentially, you want ocilogon (complex network function to login to a
MN> networked Oracle [in this case] server) to timeout just like fsockopen
MN> (fairly simple function to open a socket, including network resources).
MN> My suggestion is to try connecting using fsockopen, with the timeout.
MN> If it successfully connects - chances are, the majority of the time,
MN> your ocilogon that follows will work as well.
That's a good idea, I'll try to connect to the Oracle port thru fsockopen.
MN> Another dirty little trick you might use is running the ocilogon in a
MN> separate script and making use of set_time_limit() to make sure it
MN> doesn't run too long. Just be sure not to set_time_limit() for your
MN> whole set of scripts, unless you really want them to abort after the 5
MN> or 10 second limit you're setting ocilogon (unlikely).
I'm not sure if I can set the time limit (safemode...) but are you saying
that set_time_limit only affects the script that you include and not the
caller script?
I'll try the fsockopen "connection test" on the oracle port. Thanks for your
help.
Rgds,
Jos
| |
| Martin Norland 2005-03-24, 3:56 pm |
| Juffermans, Jos wrote:
> I understand your point but since I wasn't getting any response and never
> received a confirmation email from the system telling me that my email
> account had been verified, I wasn't sure that the original post was actually
> sent to the community. Oddly enough I got an email from the system this
> morning asking me to verify my email address - again :s
Fair enough, I've been on that boat before. :)
> The VPN connection is not always available. I'm afraid I don't have much
> control over the VPN myself and I believe only the Oracle port has been
> opened in this VPN.
You might want to contact whoever manages the VPN - it sure sounds like
it needs to always be up!
> MN> Essentially, you want ocilogon (complex network function to login to a
> MN> networked Oracle [in this case] server) to timeout just like fsockopen
> MN> (fairly simple function to open a socket, including network resources).
> MN> My suggestion is to try connecting using fsockopen, with the timeout.
> MN> If it successfully connects - chances are, the majority of the time,
> MN> your ocilogon that follows will work as well.
> That's a good idea, I'll try to connect to the Oracle port thru fsockopen.
Let us on the list know how/whether or not this works, It's definitely
worth having some info on.
> MN> Another dirty little trick you might use is running the ocilogon in a
> MN> separate script and making use of set_time_limit() to make sure it
> MN> doesn't run too long. Just be sure not to set_time_limit() for your
> MN> whole set of scripts, unless you really want them to abort after the 5
> MN> or 10 second limit you're setting ocilogon (unlikely).
> I'm not sure if I can set the time limit (safemode...) but are you saying
> that set_time_limit only affects the script that you include and not the
> caller script?
No no no - include() should be the same as if you just placed the code
right where the include is, so it would apply it to the whole script.
You'll have to call out separately and make it another process, and
exec or something - a small script whose sole intention is to determine
if the VPN is up. exec() or the likes - like I said - dirty trick/hack.
The idea is to just have it return 0 or 1 [actually, depending on how
the time limit works, it may not return anything if it ends
prematurely]. Definitely try the fsockopen bit first, and give it a few
go's if it's not working.
> I'll try the fsockopen "connection test" on the oracle port. Thanks for your
> help.
Welcome to the list!
cheers,
--
- Martin Norland, Sys Admin / Database / Web Developer, International
Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.
|
|
|
|
|