Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save juliojsb/d9c74f68fab69aa8ffc2 to your computer and use it in GitHub Desktop.
Save juliojsb/d9c74f68fab69aa8ffc2 to your computer and use it in GitHub Desktop.
Automatic reconnect to database for Jboss EAP 6.x/AS7.x
In your datasource section define background validation:
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<background-validation>true</background-validation>
<validate-on-match>false</validate-on-match>
<background-validation-millis>15000</background-validation-millis>
</validation>
Or with validate on match:
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<background-validation>false</background-validation>
<validate-on-match>true</validate-on-match>
</validation>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment