JBoss Community

Re: How to Auto-Reconnect jtds on DB restart

created by Thunder Lei in Datasource Configuration - View the full discussion

As far as I know, the  check-valid-connection-sql will do the trick for you. I verified this on both mysql and informix server.

I believe your problem lies in spring beans which is cached and hence has no chance to get the newly created connection from JBoss.

 

I would suggest that you change your datasource bean to "prototype" to try and verify my guess.

Also you need to config ALL the beans which refer to datasource bean to be "prototype".

 

BTW, configurating the datasource to be a "prototype" bean is not best practice.

If you verified that my guess turn out to be true, you need to find sulotion from spring side and not JBoss side.

 

Regards,

Thunder

Reply to this message by going to Community

Start a new discussion in Datasource Configuration at Community