users@glassfish.java.net

Re: COnnection Pool Datasource from Glassfish

From: <glassfish_at_javadesktop.org>
Date: Fri, 07 Mar 2008 09:59:14 PST

Thanks for the response I have seen your posting earlier that you have reffered the link to , but Glassfish doe'snt seem to treat all Datasource types same like Richard has commented in the thread
http://forums.java.net/jive/message.jspa?messageID=262337#262337

I'm facing same problem where in connection hits max when I use Data source instead of ConnectionPoolDatasource and I think Glassfish seem to be working like mentioned in this link where in DataSource makes physical connections and not logical connections from the pool like the ConnectionPoolDataSource
http://java.sun.com/developer/technicalArticles/J2EE/pooling/index.html

But I got it to work in cmy code using Connection pool datasource by using the vendor implemented datasource in my case OracleConnectionPoolDataSource like.

Context ctx = new InitialContext();
// OracleConnectionPoolDataSource connPoolDatasource
=(OracleConnectionPoolDataSource)ctx.lookup("java:comp/env/jdbc/AIP_TEST");

OracleConnectionPoolDataSource connPoolDatasource = new
OracleConnectionPoolDataSource();
                 
connPoolDatasource.setURL("jdbc:oracle:thin:@xxx.xx.xx.org:1521:TEST");
connPoolDatasource.setUser("username");
connPoolDatasource.setPassword("password");
PooledConnection pconn = connPoolDataSource.getPooledConnection();
Connection conn = pconn.getConnection();

But my concern still remains wherein I would like to lookup the DB connection pool by JNDI like commented in the code snippet instead of setting the db info in the code.
I've set the resource-ref and type in web.xml and on admin console also it is set to Javax.sql.ConnectionPoolDataSource for ref-type and DS classname is oracle.jdbc.pool.OracleConnectionPoolDataSource it still returns datasource type only not ConnectionPoolDataSource /OracleConnectionPoolDataSource.Looks like a bug in glassfish or I'm missing some settings /changes to configurations.
 Any thoughts..

thanks,
Meena
[Message sent by forum member 'md7777' (md7777)]

http://forums.java.net/jive/thread.jspa?messageID=262935