JBoss Community

Re: How to Auto-Reconnect jtds on DB restart

created by Viacheslav Garmash in Datasource Configuration - View the full discussion

You can try to disable caching of your JNDI datasource in Spring like this:

 

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">

     <property name="jndiName"><value>java:/MSSQLDS</value></property>

     <property name="cache" value="false" />

     <property name="proxyInterface" value="java.sql.Driver" />

</bean>

 

Here is a quote from JndiObjectFactoryBean:

 

/**

           * Set whether to cache the JNDI object once it has been located.

           * Default is "true".

           * <p>Can be turned off to allow for hot redeployment of JNDI objects.

           * In this case, the JNDI object will be fetched for each invocation.

           * <p>For hot redeployment, a proxy interface needs to be specified.

           * @see #setProxyInterface

           * @see #setLookupOnStartup

           */

Reply to this message by going to Community

Start a new discussion in Datasource Configuration at Community