Any thoughts on how to fix this issue?
or how the current code should work?

I got it to work by adding the following to InstanceKeyObjectFactory.getObjectInstance
if (obj == null) {
PerUserPoolDataSource ds = new PerUserPoolDataSource();
ds.setDataSourceName((String)ra.getContent());
obj = ds;
}


and the following server.xml
<Resource name="jdbc/bookstoreCPDS" auth="Container"
type="org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS"/>
<ResourceParams name="jdbc/bookstoreCPDS">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS</value>
</parameter>
<parameter><name>user</name><value>sa</value></parameter>
<parameter><name>password</name><value></value></parameter>
<parameter>
<name>driver</name>
<value>org.hsqldb.jdbcDriver</value></parameter>
<parameter>
<name>url</name>
<value>jdbc:hsqldb:database</value>
</parameter>
</ResourceParams>
<Resource name="jdbc/PerUserBookstore" auth="SERVLET"
type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource"/>
<ResourceParams name="jdbc/PerUserBookstore">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.datasources.InstanceKeyObjectFactory</value>
</parameter>
<parameter>
<name>instanceKey</name>
<value>java:/comp/env/jdbc/bookstoreCPDS</value>
</parameter>
</ResourceParams>


I did a quick test and found no problems this way.
Without the extra code I can't get it to work but maybe there is another way to automagically create the PerUserPoolDataSource.


Dirk



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to