commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Linda Steckel" <Li...@FriedWire.com>
Subject DBCP BasicDataSource Problems
Date Wed, 08 Jan 2003 18:08:26 GMT
Hello and Help!

I have spent days trying to understand the following.....  Read through
every thread and doc I could find and I still am stuck. I am having problems
using Tomcat, common/dbcp and Oracle 8i thin driver.  I have used Weblogic
successfully with Oracle and the thin driver for several years so I suspect
it is something with the pooling.  In fact, we are trying to move from
Weblogic to Tomcat and the database connections have been the only hang up
so far.  I've tried to read through the code but it's not at all my area of
expertise.  This is a commercial application with numerous hits to the
database by many clients all day long.  I have done testing with a single
connection as well as many connections to help debug the situation.

My server.xml configuration is at the bottom of the email.
The problems are:

1. When I have a single connection with many browsers running the same pages
that retrieve info from several tables in an Oracle database, it works
sometimes for an hour, 4 hours, 8 hours, but then without warning closes (or
invalidates) the connection.  Without a validation query in the
configuration file, a new connection does not open.  I can't figure out why
the connection is getting closed and there does not seem to be much logging
to help me figure it out.  What (and why) is happening to these connections?
The same pages are hit so the same code is running successfully for a while.

2. By adding a validation query "select 1 from dual", Connection pooling
appears to work better and longer.  If I manually close the oracle
connection via Toad (Oracle tool), another one gets established.  However,
with the browsers running, again connections seems to be left abandoned and
not reestablished after a period of time.  The error in the log file is
"Connection is closed."  But if I look at the database, there are 5 "active
connections".  But the times on them indicate that they have not been used
for hours.

3.  As a side note, the BasicDataSource documentation, says that if you set
the maxActive and the maxIdle to 0, each will have no limit.  If I set these
to 0, no connections get established and the servlets fail. fileStore[]:
java.io.EOFException

Questions:
1. What can you suggest or tell me about the above problems?
2. When and is there expected to be another official release of the pooling
code?
3. What are the differences between the dbcp.BasicDataSourceFactory and the
dbcp.Jdbc2PoolDataSource?  Is one more stable than the other?  Is there
reason to use one versus the other.  Our entire product is jsp and servlets
(no J2EE).
4. Does anyone have other suggestions for pooling?  Other pooling softwares?
I am new to Tomcat so we started with the latest version but what did people
do in prior versions?


Thanks for any help!
Linda

server.xml configuration

		<Resource name="jdbc/fwgold" auth="Container"
			      type="javax.sql.DataSource"/>

		<ResourceParams name="jdbc/fwgold">
		  <parameter>
		    <name>driverClassName</name>
		    <value>oracle.jdbc.driver.OracleDriver</value>
		  </parameter>
		  <parameter>
		    <name>url</name>
		    <value>jdbc:oracle:thin:@66.45.31.230:1521:FWIRE</value>
		  </parameter>
		  <parameter>
		  <name>validationQuery</name>
		  <value>SELECT 1 FROM DUAL</value>
		  </parameter>
		  <parameter>
		    <name>username</name>
		    <value>product</value>
		  </parameter>
		  <parameter>
		    <name>password</name>
		    <value>mypassword</value>
		  </parameter>
		  <parameter>
		  <name>maxActive</name>
		    <value>10</value>
		  </parameter>
		  <parameter>
		    <name>maxIdle</name>
		    <value>10</value>
		  </parameter>
		  <parameter>
		    <name>maxWait</name>
		    <value>-1</value>
		  </parameter>
		  <parameter>
		  <name>removeAbandoned</name>
		  <value>true</value>
		  </parameter>
                  <parameter>
                  <name>logAbandoned</name>
                  <value>true</value>
                  </parameter>
                  <parameter>
                  <name>removeAbandonedTimeout</name>
                  <value>300</value>
                 </parameter>

		</ResourceParams>


Mime
View raw message