javaee-spec
  1. javaee-spec
  2. JAVAEE_SPEC-4

Define platform default JDBC data source

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Labels:
      None

      Description

      Currently several Java EE implementations ship with an embedded database that is often also made available to user code via a pre-defined data source.

      The JNDI name under which this data source is made available differs per product. For instance GlassFish V3 uses jdbc/_default, JBoss AS 5 and 6 use java:/DefaultDS and JBoss AS 7 uses java:jboss/datasources/ExampleDS. WebLogic and WebSphere ship with embedded databases, but don't seem to have a pre-defined data source.

      I would like to propose the introduction of a platform default data source and bind this to a well-known place in the application server's JNDI tree. This data source does not have to be required to be suitable for heavy production use. Instead it should be primarily intended for testing and development purposes, as well as for applications having very moderate persistence requirements (like an admin console that needs to store a few values).

      To make use of this platform default data source, the user should not have to configure anything and should not have to manually start the embedded database separately from starting the application server.

      A diverse range of services in the Java EE platform that now do persistence in some opaque vendor specific way (like EJB timer persistence or HTTP session persistence) could possibly be mandated to make use of this default data source.

      Optionally it might be worth it to specify a portable way to let this default data source point to an external user specified database. In that way, applications and services that are written to work against the default data source can transparently and portably make use of a central database instead of the embedded one. This could also be useful for issues like EJB_SPEC-45, EJB_SPEC-47 and possibly EJB_SPEC-10.

        Activity

        Hide
        reza_rahman added a comment -

        Good write-up of the basic underlying problem.

        Show
        reza_rahman added a comment - Good write-up of the basic underlying problem.
        Hide
        Bill Shannon added a comment -

        This issue is already under discussion in the expert group:
        http://java.net/projects/javaee-spec/lists/jsr342-experts/archive/2012-03/message/56

        Show
        Bill Shannon added a comment - This issue is already under discussion in the expert group: http://java.net/projects/javaee-spec/lists/jsr342-experts/archive/2012-03/message/56
        Hide
        arjan tijms added a comment -

        Thanks reza.

        Good to see this is being discussed already. Hope this JIRA issue can contribute to that discussion.

        Show
        arjan tijms added a comment - Thanks reza. Good to see this is being discussed already. Hope this JIRA issue can contribute to that discussion.
        Hide
        Antonio Goncalves added a comment -

        And what about having a standard CDI qualifier so the container can produce these default resources that we could just inject like that :

        @Inject @DefaultResource
        DataSource myDS
        
        @Inject @DefaultResource
        Topic myTopic
        
        Show
        Antonio Goncalves added a comment - And what about having a standard CDI qualifier so the container can produce these default resources that we could just inject like that : @Inject @DefaultResource DataSource myDS @Inject @DefaultResource Topic myTopic
        Hide
        arjan tijms added a comment -

        +1 for the standard CDI qualifier.

        One additional requirement could be that the default data source should not be automatically influenced by any other data sources that an application declares to be using. If I'm not mistaken this is similar to the behavior we're seeing in existing products today. No amount of application defined data sources makes java:/DefaultDS in JBoss AS 5/6 go away or change its behavior.

        Specifically, in the presence of application specific data sources the default data source should never be automatically mapped to any of those and it also should not go away.

        This extra requirement is especially important if Java EE platform services ((like the mentioned EJB timers), or plugged-in services (like JCA connectors and CDI portable extensions) would adopt the platform default data source. A typical application that defines its own data sources for an external DB would not for example wants the data associated with EJB timers to automatically go to that external DB.

        Show
        arjan tijms added a comment - +1 for the standard CDI qualifier. One additional requirement could be that the default data source should not be automatically influenced by any other data sources that an application declares to be using. If I'm not mistaken this is similar to the behavior we're seeing in existing products today. No amount of application defined data sources makes java:/DefaultDS in JBoss AS 5/6 go away or change its behavior. Specifically, in the presence of application specific data sources the default data source should never be automatically mapped to any of those and it also should not go away. This extra requirement is especially important if Java EE platform services ((like the mentioned EJB timers), or plugged-in services (like JCA connectors and CDI portable extensions) would adopt the platform default data source. A typical application that defines its own data sources for an external DB would not for example wants the data associated with EJB timers to automatically go to that external DB.
        Hide
        ldemichiel added a comment -

        Default data source has been added.

        Show
        ldemichiel added a comment - Default data source has been added.

          People

          • Assignee:
            Unassigned
            Reporter:
            arjan tijms
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: