Disable Connection Pooling
By shalini_m on Dec 22, 2009
Connection pooling allows you to reuse connections from a pool
instead of creating a new connection object everytime. If you desire to
turn off the connection pooling in GlassFish V3, there is a new
attribute that could be used.
By default, connection pooling is enabled in both jdbc as well as
connector connection pools. To disable this, set the "pooling" attribute to false.
In the earlier releases of GlassFish, there was a system property called "com.sun.enterprise.Connectors.SwitchoffACCConnectionPooling"
that could be set to true to turn off connection pooling in application
clients. This property is still supported in the new GlassFish V3.
How to set the flag
In administration CLI, use the following :
asadmin set server.resources.jdbc-connection-pool.
In admin GUI http://localhost:4848, see the Pooling checkbox.
- Associate with thread functionality is invalid
- Flush connection pool cannot be done
There are a few attributes that are useful only in pooled environment hence a WARNING message is seen in the server.log when they are used.
- Connection validation
- Validate Atmost Once (Related to Connection Validation)
- Match Connections
- Max Connection Usage
- Idle Timeout