Skip to content
This repository has been archived by the owner on Jan 30, 2019. It is now read-only.

Define platform default JDBC data source #4

Closed
glassfishrobot opened this issue Mar 18, 2012 · 9 comments
Closed

Define platform default JDBC data source #4

glassfishrobot opened this issue Mar 18, 2012 · 9 comments

Comments

@glassfishrobot
Copy link

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.

@glassfishrobot
Copy link
Author

Reported by arjan_t

@glassfishrobot
Copy link
Author

reza_rahman said:
Good write-up of the basic underlying problem.

@glassfishrobot
Copy link
Author

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

@glassfishrobot
Copy link
Author

arjan_t said:
Thanks reza.

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

@glassfishrobot
Copy link
Author

agoncal said:
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

@glassfishrobot
Copy link
Author

arjan_t said:
+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.

@glassfishrobot
Copy link
Author

ldemichiel said:
Default data source has been added.

@glassfishrobot
Copy link
Author

Marked as fixed on Wednesday, August 22nd 2012, 12:52:55 pm

@glassfishrobot
Copy link
Author

This issue was imported from java.net JIRA JAVAEE_SPEC-4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant