jboss pooling
renierb Jul 4, 2006 4:59 AMI have setup a datasoure and pooling(for postgresql) in my JSP page.
The datasource works, but I am not sure if the pooling is working.
Here is what i have done:
1.) C:\jboss-4.0.4RC1\server\default\deploy\postgres-ds.xml:
------------------------------------------------------------------------
<local-tx-datasource>
<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc:postgresql://pghost/sekunjalo</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>iis</user-name>
<!-- sql to call when connection is created. Can be anything, select 1 is valid for PostgreSQL
<new-connection-sql>select 1</new-connection-sql>
-->
<!-- Pools are lazily constructed on first use -->
<!-- The min connections in a pool/sub-pool -->
<min-pool-size>1</min-pool-size>
<!-- The max connections in a pool/sub-pool -->
<max-pool-size>2</max-pool-size>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>15</idle-timeout-minutes>
<!-- sql to call on an existing pooled connection when it is obtained from pool. Can be anything, select 1 is valid for PostgreSQL
<check-valid-connection-sql>select 1</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>PostgreSQL 7.2</type-mapping>
</local-tx-datasource>
-------------------------------------------------------------------------------
2.) In my C:\jboss-4.0.4RC1\server\default\deploy\ROOT.war\WEB-INF folder, I have web.xml and jboss-web.xml
web.xml
-------------------------------------------------------
<resource-ref>
<res-ref-name>jdbc/fnbDbPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>
Container
</res-auth>
</resource-ref>
----------------------------------------------------------
jboss-web.xml
---------------------------------------------------------
<resource-ref>
<res-ref-name>jdbc/fnbDbPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/PostgresDS</jndi-name>
</resource-ref>
--------------------------------------------------------
and i have my driver also in my lib folder, everything work, but is this all i need to do to activate or use the pooling?