users@glassfish.java.net

Informix Connection Pool which settings take precedence ?

From: <forums_at_java.net>
Date: Sat, 29 Sep 2012 19:49:17 -0500 (CDT)

Hey pips, I am using GlassFish 3.1.2.2 with Informix Dynamic Server 11.10FCx.
I am trying to setup a JDBC connection pool using the latest version of the
Informix JDBC drivers (3.70.JC9). I've created the pool as
javax.sql.ConnectionPoolDataSource resource using the
com.informix.jdbcx.IfxConnectionPoolDataSource dataSource class and the
com.informix.jdbc.ifxDriver driver. This kind of resource has like 30
addition properties, most of which are useless to me. What is confusing is
that it has the following additional properties(taken from the domain.xml
file for easier reading): property name="InitialPoolSize" value="0">property
property name="MinPoolSize" value="0">property property name="MaxPoolSize"
value="50">property ... property name="IfxCPMInitPoolSize" value="0">property
property name="IfxCPMMinPoolSize" value="0">property property
name="IfxCPMMaxPoolSize" value="50">property ... property
name="IfxCPMMaxConnections" value="-1">property> So which settings take
precedence? The ones in the General tab of the GF admin console, or the
properties with or without IfxCPM in the beginning? Why do we have 3
different properties for the at a glance the same settings ? And why we have
one additional setting to limit the max number of connections(which should be
limited by the MaxPoolSize already ?..?) And my second question is what is
the proper way of getting the dataSource ? What I do is: I call the
ic.lookup() for the JNDI resource mapped to the JDBC connection pool and I
cast that object to javax.sql.dataSource object. I think I tried casting it
to javax.sql.ConnectionPoolDataSource first but it failed. So is taking a
dataSource object making that dataSource not pooled ? I got an answer to that
question, before my old topic bugged and disappeared :D. The proper way of
getting a connection from a pooled ConnectionPoolDataSource which is managed
by the application server is by casting it to a normal dataSource. Basically
you webapp doesn't even know that it is working with
ConnectionPoolDataSource, all of "the pooling" is handled by the application
server.

--
[Message sent by forum member '2g4u']
View Post: http://forums.java.net/node/890866