[jboss-user] [Datasource Configuration] - Re: How to Auto-Reconnect jtds on DB restart

Viacheslav Garmash do-not-reply at jboss.com
Fri Apr 15 12:59:25 EDT 2011

Viacheslav Garmash [http://community.jboss.org/people/vgarmash] created the discussion

"Re: How to Auto-Reconnect jtds on DB restart"

To view the discussion, visit: http://community.jboss.org/message/600364#600364

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" />

Here is a quote from  http://static.springsource.org/spring/docs/2.5.6/api/org/springframework/jndi/JndiObjectFactoryBean.html#setCache(boolean) 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110415/9504bebc/attachment.html 

More information about the jboss-user mailing list