tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Pell <Jason.P...@dssonline.com.au>
Subject Re: Tomcat/firewall/oracle timeout problem
Date Fri, 02 Feb 2001 00:42:47 GMT
Instead of checking if the Connection is null, why not try a simple test of
whether
the connection is still active.

Try a query: "select USER from dual" for instance, if an exception is thrown
this
indicates the connection is invalid and needs to be reset.

You might also like to take a look at the connection pooling software from
javaexchange, called DbConnectionBroker, which can take care of and reinitialise

expired/invalid connections.

Cheers
Jason

Yin Tse wrote:

> Hi all,
> I'm having a problem with a jdbc connection object between tomcat and an
> oracle server. The 2 machines are separated by a firewall which was
> configured to allow access to the oracle server from the tomcat server only.
> The problem starts when the timeout period(which can be set to an arbitray
> time period) of idle time runs out. It sends a timeout signal and that
> breaks the jdbc connection. The application then freezes any attempts to log
> in/manage your account or do activities which need database connection. But
> tomcat still works fine, any servlets which do not need database connection
> works fine.
> I added some code to check if my connection object is null and to create a
> new one if it is so. That didn't solve the problem which means that the
> connection object is not killed, but its content (like db driver, conn url ,
> login & password etc..)is somehow scrambled. My question is how can I manage
> those jdbc connection objects and how to figure out when something went
> wrong with the connection object ? Thanks all.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org

--
Jason Pell
Senior Analyst/Programmer - Web Developer
Deakin Software Services Pty Ltd
12 Gheringhap St, Geelong Victoria 3220 Australia
Phone: 03 5227 8858 International: +61 3 5227 8858
Fax: 03 5227 8907 International: +61 3 5227 8907
E-mail Jason.Pell@dssonline.com.au
http://www.dssonline.com.au
Customer Support Hotline: 1800 620 497

"Callista - the brightest solution in university management"

---------------------------------------------------------------
Important Notice: The contents of this email transmission,
including attachments, may be privileged and confidential.
Any unauthorised use of the contents is expressly prohibited.
If you have received this transmission in error, please advise
the sender by return email or telephone immediately and
destroy all versions.
---------------------------------------------------------------



Mime
View raw message