1 Reply Latest reply on Oct 28, 2016 12:12 AM by jaikiran

    what is ExampleDS and what is side effect if remove it

    hchenkwi

      Hi there,

       

      I use Wildfly10.0.0.Final.

       

      I see by default the standalone.xml has datasource for ExampleDS,

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

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

                          <driver>h2</driver>

                          <security>

                              <user-name>sa</user-name>

                              <password>sa</password>

                          </security>

                      </datasource>

      and it seems to be set as datasource default bindings.

                <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>

       

      The document says EE subsystem looks up the default instances from JNDI using the names in the default bindings configuration, before placing those in the standard JNDI names.

       

      I'm not fully understanding this part? How can I look at this default datasource to see what names is in it? and where defines standard JNDI names? when I define datasource with jndi-name, what name should I following?

       

      I may be lack of some basic knowledge here, if you can give me some information or point me to some place to read, that will be helpful for me to understand this.

       

      Thanks a lot,

       

      Helen

        • 1. Re: what is ExampleDS and what is side effect if remove it
          jaikiran

          You should be able to remove references to ExampleDS without impacting any functionality in the server. ExampleDS was meant to be just that - an example that can be quickly looked within the shipped configurations (without the need to go look into a possibly out of date doc).

           

          Later in the release cycle of WildFly and Java EE7 spec, the concept of "default datasource" was introduced (see EE.5.19 section of Java EE7 spec for more details). The default datasource is expected to be bound into the Java EE component specific namespace (a.k.a ENC) and is available at java:comp/DefaultDataSource. That ENC JNDI name is just a link to the container specific default shipped datasource and in this case just links to java:jboss/datasources/ExampleDS.

           

          So if you do remove that ExampleDS, all you have to do is come up with your own datasource which can be considered as the default datasource and the JNDI name of that datasource is what you use in the <default-bindings> element of the EE subsystem configuration.