Separate *-ds.xml in EAP 6?

Latest response

As it is stands in JBoss AS 7, community edition, which will feed EAP 6, datasource configuration files, *.-ds.xml, are part of the single configuration file.

 

I am wonding what our customers think about this? Would you prefer to separate your *-ds.xml files from the single configuration file, or is it ok to keep them part of this single configuration file.

 

Here is a example of the configuration file in EAP 5:

 

<datasources>
   <local-tx-datasource>

      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
      <!-- Datasources are not available outside the virtual machine -->
      <jndi-name>ExampleDS</jndi-name>

      <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>

      <!-- The driver class -->
      <driver-class>org.hsqldb.jdbcDriver</driver-class>

      <!-- The login and password -->
      <user-name>sa</user-name>
      <password>sa</password>

      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
      <min-pool-size>0</min-pool-size>

      <!-- The maximum connections in a pool/sub-pool -->
      <max-pool-size>20</max-pool-size>

      <idle-timeout-minutes>0</idle-timeout-minutes>

      <!-- Whether to check all statements are closed when the connection is returned to the pool,
           this is a debugging feature that should be turned off in production -->
      <track-statements/>

      <!-- Use the security domain defined in conf/login-config.xml -->
      <security-domain>HsqlDbRealm</security-domain>

      <!-- HSQL DB benefits from prepared statement caching -->
      <prepared-statement-cache-size>32</prepared-statement-cache-size>

      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
      <metadata>
         <type-mapping>Hypersonic SQL</type-mapping>
      </metadata>

      <!-- When using in-process (standalone) mode -->
      <depends>jboss:service=Hypersonic,database=localDB</depends>
   </local-tx-datasource>

   <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
   <mbean code="org.jboss.jdbc.HypersonicDatabase"
     name="jboss:service=Hypersonic,database=localDB">
     <attribute name="Database">localDB</attribute>
     <attribute name="InProcessMode">true</attribute>
   </mbean>
   
</datasources>

 

And the equivilent in AS7, in context of complete config file.

 

<server name="jshepher" xmlns="urn:jboss:domain:1.0">
    <extensions>
        <extension module="org.jboss.as.clustering.infinispan"/>
        <extension module="org.jboss.as.connector"/>
        <extension module="org.jboss.as.deployment-scanner"/>
        <extension module="org.jboss.as.ee"/>
        <extension module="org.jboss.as.ejb3"/>
        <extension module="org.jboss.as.jaxrs"/>
        <extension module="org.jboss.as.jmx"/>
        <extension module="org.jboss.as.jpa"/>
        <extension module="org.jboss.as.logging"/>
        <extension module="org.jboss.as.naming"/>
        <extension module="org.jboss.as.osgi"/>
        <extension module="org.jboss.as.remoting"/>
        <extension module="org.jboss.as.sar"/>
        <extension module="org.jboss.as.security"/>
        <extension module="org.jboss.as.threads"/>
        <extension module="org.jboss.as.transactions"/>
        <extension module="org.jboss.as.web"/>
        <extension module="org.jboss.as.weld"/>
    </extensions>
    <management>
        <security-realms>
            <security-realm name="PropertiesMgmtSecurityRealm">
                <authentication>
                    <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
                </authentication>
            </security-realm>
        </security-realms>
        <management-interfaces>
            <native-interface interface="management" port="9999"/>
            <http-interface interface="management" port="9990"/>
        </management-interfaces>
    </management>
    <profile>
        <subsystem xmlns="urn:jboss:domain:logging:1.0">
            <console-handler name="CONSOLE" autoflush="true">
                <level name="INFO"/>
                <formatter>
                    <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                </formatter>
            </console-handler>
            <periodic-rotating-file-handler name="FILE" autoflush="true">
                <level name="INFO"/>
                <formatter>
                    <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                </formatter>
                <file relative-to="jboss.server.log.dir" path="server.log"/>
                <suffix value=".yyyy-MM-dd"/>
            </periodic-rotating-file-handler>
            <logger category="com.arjuna">
                <level name="WARN"/>
            </logger>
            <logger category="org.apache.tomcat.util.modeler">
                <level name="WARN"/>
            </logger>
            <logger category="sun.rmi">
                <level name="WARN"/>
            </logger>
            <root-logger>
                <level name="INFO"/>
                <handlers>
                    <handler name="CONSOLE"/>
                    <handler name="FILE"/>
                </handlers>
            </root-logger>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:datasources:1.0">
            <datasources>
                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                    <connection-url>
                        jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
                    </connection-url>
                    <driver>
                        h2
                    </driver>
                    <pool>
                        <prefill>
                            false
                        </prefill>
                        <use-strict-min>
                            false
                        </use-strict-min>
                        <flush-strategy>
                            FailingConnectionOnly
                        </flush-strategy>
                    </pool>
                    <security>
                        <user-name>
                            sa
                        </user-name>
                        <password>
                            sa
                        </password>
                    </security>
                    <validation>
                        <validate-on-match>
                            false
                        </validate-on-match>
                        <background-validation>
                            false
                        </background-validation>
                        <useFastFail>
                            false
                        </useFastFail>
                    </validation>
                </datasource>
                <drivers>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>
                            org.h2.jdbcx.JdbcDataSource
                        </xa-datasource-class>
                    </driver>
                </drivers>
            </datasources>
        </subsystem>

        <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.0">
            <deployment-scanner name="default" path="deployments" scan-enabled="true" scan-interval="5000" relative-to="jboss.server.base.dir" deployment-timeout="60"/>
        </subsystem>

        ...

   </profile>

</server>

Responses

I know one major concern raised is that this would be a migration nightmare for customers that have hundreds or not thousands of applications in their production environment that has its own *-ds.xml. This is definitely something to think about for migration use cases.

It seems having hundreds of datasources defined in the single configuration file would be a maintence nightmare.  Perhaps if there was a clean Graphical method of maintaining these datasource separately, that might be acceptable, but I know many system administrators like to maintain things as files, so they can harness the underlying OS features, such as version control, and network syncronizing to perform maintence.

 

I guess ideally we have an option to have the datasources defined in line, as in AS7, but also allow users to deploy their *-ds.xml files as standalone files. Not sure what would be required to accomplish that, would the *-ds.xml files have to be deployed with applications under deploy?

we're using JBoss EWP 5.1.0. each application has its own -ds.xml file and we find it very convenient to compare files for instance. I hope this feature will still be available in the next version.

 

In our team, one has to deal with applications, datasources, logs and jndi resources and another with more platform-oriented files, so we know we're not breaking the other files when working on ours.

We are lucky in that we utilize only two ds.xml files on each cluster node (in each cluster) with multiple DS's in each file. Our migration will be relatively simple but still an issue. However the idea of migrating hundreds or thousands of these configurations is terrifying.

The idea of having one single configuration file is to have... one single configuration file. Although when it comes to hundreds or thousands of datasources, we know who's time won't be enough to maintain them. So I think the best option would be to let the admin choose what method they think it's best for their environments. For us, I'd choose to have them into the single config file.

 

And please, work on a migration tool :)

I completly agree with Sebastian. I would only add, the one big single configuration file should have a small simple admin page, for those who choose to walk this way.

This does make good sense. The apps I manage currently would do well under a single DS file, but we've got some POC apps coming down the pipeline that may change all that. In such case I'd like to be able to manage it the way I want and not be bound to only one way.

 

+1 on the migration tool, will be absolutely necessary in my situation, as I'm sure will be the case for so many others.

The IronJacamar project will provide a tool that can help in the migration of
the old -ds.xml format to an EAP 6 configuration.

Note that I was told these formats are very different, so a reconfiguration of all your
datasources and resource adapters are needed no matter what.

I know many users who put the data source configuration inside their EAR packages, and this single file would break this.

 

Having separare *-ds.xml files for each datasource (or for each applications datasource) also makes it easier to use scripts to deploy an app and all its configs. I understand the new admin cli would take care of that, but i guess many will prefer (I would) mantain a configuration file that can be replicated than a script that creates the datasources.

Datasource *-ds.xml have been added back

 

Example of a *-ds.xml

 

create a file in $JBOSS_HOME/standalone/deployments/test-ds.xml

Put this in it, this will create a simple h2 database using the driver in EAP 6.

 

<datasources>
<datasource jndi-name="java:jboss/datasources/TestDSXML" pool-name="TestDSXML" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:testDSXML;DB_CLOSE_DELAY=-1</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
</datasources>