3 Replies Latest reply on Nov 7, 2012 9:54 AM by jaikiran

    standalone.xml datasource enabled-flag are overwritten after second server restart

    nimo22

      I am using Jboss 7.1.1 FINAL and have 4 datasources defined within standalone.xml.

       

      All works fine.

       

      Now, I want to disable three of them and declare it within standalone.xml by setting enabled="false".

       

      <datasource jta="true" jndi-name="java:/ds-one" pool-name="pool-one" use-java-context="true" use-ccm="true" enabled="true">

      <datasource jta="true" jndi-name="java:/ds-two" pool-name="pool-one" use-java-context="true" use-ccm="true" enabled="false">

      <datasource jta="true" jndi-name="java:/ds-three" pool-name="pool-one" use-java-context="true" use-ccm="true" enabled="false">

      <datasource jta="true" jndi-name="java:jboss/datasources/ExampleDS" pool-name="pool-one" use-java-context="true" use-ccm="true" enabled="false">

       

      When restarting the server again, the three datasources are correctly not bound within the application server, only "java:/ds-one" is bound:

       

      12:49:00,416 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:/ds-one]

       

      However, when stopping the server, deploying the web-archive and restarting the server again,

      my settings of the datasources enabled-flag in standalone.xml are changed (but not by myself!).

      The property enabled=false are removed from the standalone.xml.


      Hence, the server bounds the 4 datasources again unfortunately:

       

      12:49:00,416 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) JBAS010400: Bound data source [java:/ds-two]

      12:49:00,417 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) JBAS010400: Bound data source [java:/ds-three]

      12:49:00,417 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

       

       

      Is this a bug?

        • 1. Re: standalone.xml datasource enabled-flag are overwritten after second server restart
          sfcoy

          Are you editing the standalone.xml while the server is running? This will cause inconsistent results.

           

          Try using the CLI:

           

          {code:bash}[standalone@localhost:9999 /] data-source enable --name=pool-one{code}

           

          ...and as I entered this I noticed that your pool-names are all the same. I think these need to be unique, which may be the cause of your problem.

          • 2. Re: standalone.xml datasource enabled-flag are overwritten after second server restart
            nimo22

            For each datasource, I have a different pool-name.

             

            I stopped the server and edit the standalone.xml as decribed above (with enabled="false"-Property)

             

            I start the server and looked at the log-file: datasources with enabled="false" are not loaded, which is correctly.

             

            However, when I stop the server the second time and restart it again, then enabled="false" were all deleted - but NOT by myself. Hence, the former disabled datasources are enabled and bounded.

             

            You can try it for yourself:

            - Stop the server, disable a datasource.

            - Start the server. (the first time, it will be correctly set).

            - Then again, stop the server and start it again (without editing standalone.xml).

            ->You will see, that the datasource is now bounded again. Why is that so?

            • 3. Re: standalone.xml datasource enabled-flag are overwritten after second server restart
              jaikiran

              I think this might have been fixed in upstream version. Please try against latest nightly build.