You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/09/29 19:00:35 UTC

DO NOT REPLY [Bug 23491] New: - Can't configure PerUserPoolDataSource for use with tomcat

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23491>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23491

Can't configure PerUserPoolDataSource for use with tomcat

           Summary: Can't configure PerUserPoolDataSource for use with
                    tomcat
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: jmcnally@apache.org


This bug was originally submitted by Mike Hanafey:

If have been trying to get connection pooling to work in tomcat 5.0.9
and Sybase. I downloaded a nightly DBCP yesterday, but cannot get
the factory right for defining a "PerUserPoolDataSource". The
"ctx.lookup" returns null. This what I have in server.xml:

                    <Resource name="jdbc/pubs2new" auth="Container"
                        
type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource"
                        description="The infamous pub2 test database"/>
                    <ResourceParams name="jdbc/pubs2new">
                        <parameter>
                            <name>factory</name>
                            
<value>org.apache.commons.dbcp.datasources.InstanceKeyObjectFactory</value>
                        </parameter>
                        <parameter>
                            <name>dataSourceName</name>
                            <value>java:comp/env/jdbc/pubsCPDS</value>
                        </parameter>
                        <parameter>
                            <name>defaultMaxActive</name>
                            <value>30</value>
                        </parameter>
                    </ResourceParams>
                </DefaultContext>

I, John McNally, attempted to test this using a <Context> element instead of
<DefaultContext> and using Tomcat/4.1.24.

<Resource name="pubs" auth="Container"
    type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource"
    description="The infamous pub2 test database"/>

  <ResourceParams name="pubs">
    <parameter>
      <name>factory</name>                    
<value>org.apache.commons.dbcp.datasources.InstanceKeyObjectFactory</value>
    </parameter>
  </ResourceParams>
</Context>

And web.xml:

<resource-ref>
  <description>
    foo
  </description>
  <res-ref-name>pubs</res-ref-name>
  <res-type>org.apache.commons.dbcp.datasources.PerUserPoolDataSource</res-type>    
  <res-auth>
    Container
  </res-auth>
</resource-ref>