You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/05/16 12:48:33 UTC

[Bug 53240] New: [tomcat jdbc connection pool] Open x-times database sessions than expected

https://issues.apache.org/bugzilla/show_bug.cgi?id=53240

          Priority: P2
            Bug ID: 53240
          Assignee: dev@tomcat.apache.org
           Summary: [tomcat jdbc connection pool] Open x-times database
                    sessions than expected
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: fangtianying@hexun.com
          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.

[Bug 53240] [tomcat jdbc connection pool] Open x-times database sessions than expected

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53240

--- Comment #2 from Filip Hanik <fh...@apache.org> ---
misconfiguration. conf/context.xml will create one pool per webapp.
global pools are configured in server.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53240] [tomcat jdbc connection pool] Open x-times database sessions than expected

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53240

Rob Moore <ro...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rob.moore+apache@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53240] [tomcat jdbc connection pool] Open x-times database sessions than expected

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53240

Chuck Caldarale <ch...@unisys.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Chuck Caldarale <ch...@unisys.com> ---
Bugzilla is not a support forum.  Please post your query on the Tomcat users
mailing list so people can help correct your configuration error.

-- 
You are receiving this mail because:
You are the assignee for the bug.