https://issues.apache.org/bugzilla/show_bug.cgi?id=53240
Priority: P2
Bug ID: 53240
Assignee: [email protected]
Summary: [tomcat jdbc connection pool] Open x-times database
sessions than expected
Severity: normal
Classification: Unclassified
OS: All
Reporter: [email protected]
Hardware: All
Status: NEW
Version: 7.0.27
Component: Catalina
Product: Tomcat 7
Problem:
tomcat open 'x' times database sessions than configured. 'X' equals the number
of subfolders/applications under tomcat webapps/ folder.
To reproduce this problem, plz follow the steps below (I tested this case both
on oracle 10g and oracle 10g express , and i guess it works with all databases)
step 1.
configure a jdbc data source by adding the following text to tomcat
conf/context.xml, and don'nt forget to add proper jdbc jar[s] to tomcat lib/
(using the new 'tomcat jdbc connection pool' that came with tomcat 7. And
notice that we set the pram maxActive=maxIdle=2 )
<Resource name="jdbc/myoracle" auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@127.0.0.1:1521:XE"
username="xe" password="xe" maxActive="2" maxIdle="2"
maxWait="1000"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" />
step 2. start tomcat
step 3. loggin to oracle, and execute the following sql :
select SID, USERNAME from v$session where USERNAME='XE';
the sql returns 10 instead of 2(5 times than expected. And the number of
subfolders of tomcat/webapps/ is just 5 ).
For further test, we can remove a foler from webapps/, let's say 'docs', and
stop tomcat and repeat step 2 and 3. After step 3, the sql will return 8
because there are 4 subfolers left in webapps/.
---
I don't think it's a feature because the sessions in a database will increase
by 100 (if the params 'maxActive/maxIdle' were set to 100) in case I just
simply create a foler under webapps/. If something like that happend, my boss
could kill me.
--
You are receiving this mail because:
You are the assignee for the bug.