5 Replies Latest reply on Sep 2, 2013 1:19 AM by karna spartacus

    Is background connection validation without on-the-fly validation possible?

    Bojan Dolinar Newbie

      Hi!

       

      I want background validation only and I expected this to be the motivation for background-validation tag. When enabled, however, this option works only with check-valid-connection-sql, but this always comes with validation on connection check-out. Doesn't this defeat the purpose of background-validation? What am I missing?

       

      I'm using JBoss AS 4.2.2.GA.

       

      This is part of configuration that I'm using:

      <idle-timeout-minutes>5</idle-timeout-minutes>

      <!-- Validation works only when next line is not commented, but validation also happens at connection check-out -->
      <!--<check-valid-connection-sql>select count(*) from gu_gemaSystemSettings</check-valid-connection-sql>-->
      <background-validation>true</background-validation>
      <background-validation-minutes>1</background-validation-minutes>

       

      Thx for help!

        • 1. Re: Is background connection validation without on-the-fly validation possible?
          Glauber Ribeiro Newbie

          Did you try

           

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

              <validate-on-match>false</validate-on-match>

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

          ?
          • 3. Re: Is background connection validation without on-the-fly validation possible?
            Bojan Dolinar Newbie

            Hi Glauber,

             

            Yes, this helps and it makes perfect sense now. Thx a lot!

             

            The description for <check-valid-connection-sql> somehow misled me into believing that it also implicitly turns on the validation and that background-validation = true in turn implicitly changes the semantic. Something like "an sql statement that is used for validating the connection. Validation can be triggered by every connection check-out (default; see <validate-on-match>) or/and asynchronously in the background (see <background-validation>)" would be much more helpful.

             

            Again, thx for help.

            • 5. Re: Is background connection validation without on-the-fly validation possible?
              karna spartacus Newbie

              hi, i tried this,but i got this error...

               

              10:46:36,867 ERROR [org.jboss.as.server] JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration

                at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:141) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.server.ServerService.boot(ServerService.java:266) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:155) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]

              Caused by: javax.xml.stream.XMLStreamException: org.jboss.as.connector.util.ParserException: IJ010061: Unexpected element: background-validation

                at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:784)

                at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:333)

                at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final]

                at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]

                at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:894) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_1(StandaloneXml.java:330) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:127) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:100) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final]

                at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]

                at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:133) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

                ... 3 more

              Caused by: org.jboss.as.connector.util.ParserException: IJ010061: Unexpected element: background-validation

                at org.jboss.as.connector.subsystems.datasources.DsParser.parseDataSource(DsParser.java:714)

                at org.jboss.as.connector.subsystems.datasources.DsParser.parseDataSources(DsParser.java:194)

                at org.jboss.as.connector.subsystems.datasources.DsParser.parse(DsParser.java:165)

                at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:776)

                ... 13 more

               

               

              Same error came for <validate-on-match>false</validate-on-match>..

              like unexpected element : validate-on-match..