4 Replies Latest reply on Jun 13, 2013 10:13 AM by Stephen Coy

    Does JBoss 7 require its own Database?

    bhavesh bhagat Newbie

      Hi All,


      In Case of the older release of the JBoss, it used to require the database of its own (Came as "DefaultDS"). Is it still the requirement for JBoss 7 OR it can leave without database?


      Please advise.


      Thank you!

        • 1. Re: Does JBoss 7 require its own Database?
          jaikiran pai Master

          AS7 and WildFly don't require a database. The "ExampleDS" that AS7 and WildFly ship are just an example and isn't used by any of the out-of-box services in the server.

          • 2. Re: Does JBoss 7 require its own Database?
            Stephen Coy Master

            It's actually a spec requirement that a Java EE implementation provide a default datasource that connects to a database.


            From §EE2.6 of the Java EE 7 spec:

            {quote}The Java EE platform requires a database, accessible through the JDBC API, for the storage of business data. The database is accessible from web components, enterprise beans, and application client components. The database need not be accessible from applets. The Java EE Product Provider must also provide a preconfigured, default data source for use by the application in accessing this database. See Section EE.5.19, “Default Data Source”.{quote}

            • 3. Re: Does JBoss 7 require its own Database?
              bhavesh bhagat Newbie

              Hi Stephen,


              Thank you for your response. But, I had worked with IBM WebSphere for years and they never required database to run WebSphere. Also, in earlier version of JBoss, in the product guide, there was a separate section covering how to configure "DefaultDS" with other databases. But, in JBoss 7, we do not have DefaultDS and they are not talking about default datasource at all.


              Thank you!

              • 4. Re: Does JBoss 7 require its own Database?
                Stephen Coy Master

                WebSphere has always shipped with a Derby database instance available in it.


                But, to answer your original question:


                Earlier versions of JBoss defined a default datasource (aka "DefaultDS") because it had subsystems such as messaging and EJB timers that depended upon it in order to be able to persist messages, timers, etc.


                JBossAS7/WildFly no longer has these dependencies as the equivalent subsystems use other techniques for their persistence requirements. I believe that database persistence of timers is making a (optional I think) comeback in WildFly 8.0.


                However, WildFly 8.0 is also a Java EE 7 implementation, and the EE7 spec defines a default datasource that must be available to all applications at java:comp/DefaultDataSource.


                So, in summary a default datasource is not required in AS7, but it is a spec requirement in AS8.