Options

"RapidMiner Server complains that a database connection was closed. How can I re-establish it"

User13User13 Member Posts: 155 Maven
edited May 2019 in Knowledge Base

Problem:

JBoss pools SQL connections. When connections are closed for various reasons (errors, timeouts, network problems), it does not realize that this has happens and returns closed connections the next time they are required.

Solution:

Force JBoss to check whether the connection is still live before returning them from the pool. If not, it will re-establish the connection. To achieve this, insert the following into the standalone.xml configuration file (found under standalone/configuration):


<check-valid-connection-sql> sql code</check-valid-connection-sql>

after the XML element


<validate-on-match>true</validate-on-match>

For sql code, insert arbitrary (fast) SQL code like


SELECT 1

or (for Microsoft SQL Server)


SELECT 1 FROM sysobjects

Note that this may very slightly influence performance. You may also want to try setting


<background-validation>false</background-validation>

to


<background-validation>true</background-validation>


Tagged:
Sign In or Register to comment.