How to configure the datasource property valid-connection-checker-properties in JBoss EAP

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7
    • 6

Issue

  • Configure custom properties for a valid-connection-checker class that provides Java Bean style setter methods

Resolution

If a valid-connection-checker class has one or more custom properties, they may be set as illustrated below using Content from github.com is not included.JDBC4ValidConnectionChecker. Appropriate set<PropertyName>(...) methods are expected to be defined in the validation class. Note that case matters in matching the propertyName to the relevant setPropertyName(...) method. For example, pingTimeOut matches the case of the Content from github.com is not included.setPingTimeOut(int) method rather than the case of the private pingTimeout class attribute.

                    <validation>
                        <validate-on-match>true</validate-on-match>
                        <background-validation>false</background-validation>
                        <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.novendor.JDBC4ValidConnectionChecker">
                            <config-property name="pingTimeOut">3</config-property>
                        </valid-connection-checker>
                        ...
                    </validation>
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.