I'v schedule application that interactive on database periodically. as application get connection through dbcp and continue, the SQLException was catched due to some reason;program break this route and wait next schedule, but next schedule encounter same SQLException, my memory then hold by many many database process( in my postgresql database is postgres.exe) as if my connections can't close by dbcp.
my question is how to configure to close those connections when SQLException happen,otherwise my memory will be occupy by those unreleased connection till my machine breakdown.
here is my configuration in spring application context declaration.
------------------------------------------------------------------------------------------------------------
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
abstract="false" singleton="true" lazy-init="default" autowire="default"
dependency-check="default">
<property name="driverClassName">
<value>org.postgresql.Driver</value>
</property>
<property name="url">
<value>jdbcostgresql://127.0.0.1/irisApp</value>
</property>
<property name="username">
<value>postgres</value>
</property>
<property name="password">
<value>postgres</value>
</property>
<property name="validationQuery">
<value>SELECT 1</value>
</property>
<property name="maxActive" value="80" />
<property name="maxIdle" value="10" />
<property name="maxWait" value="2000" />
<property name="poolPreparedStatements" value="true" />
<property name="removeAbandoned" value="true" />
</bean>
------------------------------------------------------------------------------------------------------------------
any help?
Regards


ostgresql://127.0.0.1/irisApp</value>
Reply With Quote