Subject Re: [Firebird-Java] FB connection pool in Spring/Hibernate
Author Stefan Mühlemann
Hi,

shouldnt the destroy-method be "shutdown"?

<bean id="dataSource" class="org.firebirdsql.pool.FBWrappingDataSource"
destroy-method="shutdown">

Eugene Prokopiev schrieb:
>
> Hi,
>
> Pooled connections to database are not closing after stopping spring
> application.
>
> My app-servlet.xml:
>
> ...
> <bean id="dataSource" class="org.firebirdsql.pool.FBWrappingDataSource"
> destroy-method="close">
> <property name="database"><value>192.168.1.1:db</value></property>
> <property name="userName"><value>sysdba</value></property>
> <property name="password"><value>system</value></property>
> <property name="maxPoolSize"><value>1</value></property>
> <property name="minPoolSize"><value>1</value></property>
> <property name="maxStatements"><value>10</value></property>
> <property name="type"><value>TYPE4</value></property>
> </bean>
>
> <bean id="sessionFactory"
> class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
> <property name="mappingDirectoryLocations">
> <list>
> <value>WEB-INF/classes/datamodel</value>
> </list>
> </property>
> <property name="hibernateProperties">
> <props>
> <prop
> key="hibernate.dialect">net.sf.hibernate.dialect.FirebirdDialect</prop>
> </props>
> </property>
> <property name="dataSource"> <ref bean="dataSource"/></property>
> </bean>
> ...
>
> Pooled connections to database are closing propertly if I use Hibernate
> built-in connection pool:
>
> <bean id="sessionFactory"
> class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
> <property name="mappingDirectoryLocations">
> <list>
> <value>WEB-INF/classes/datamodel</value>
> </list>
> </property>
> <property name="hibernateProperties">
> <props>
> <prop
> key="hibernate.dialect">net.sf.hibernate.dialect.FirebirdDialect</prop>
> <prop
> key="hibernate.connection.driver_class">org.firebirdsql.jdbc.FBDriver</prop>
>
>
> <prop
> key="hibernate.connection.url">jdbc:firebirdsql:192.168.1.1:db</prop>
> <prop key="hibernate.connection.username">sysdba</prop>
> <prop key="hibernate.connection.password">system</prop>
> </props>
> </property>
> </bean>
>
> How can I close pooled connections with Firebird connction pool?
>

--
Stefan Mühlemann, kreiseins mühlemann
Farbgasse 47, CH - 4900 Langenthal
phone: +41-(0)629231306 fax: +41-(0)629231307