Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jan 30, 2019. It is now read-only.
This repository was archived by the owner on Jan 30, 2019. It is now read-only.

Enable Implicit Persistence Unit from Data Source? #41

Copy link
Copy link

Description

@glassfishrobot
Issue body actions

With platforms like Ruby and Play! the underlying persistence engine is often automatically enabled when a data source is defined for the application (in fact these platforms often assume only one data source per application). More recently Spring Boot appears to have understandably adopted this convention as well, ironically utilizing the JPA bootstrap API. We should explore if this is the correct default convention for Java EE.

Specifically this would mean detecting an application defined data source (e.g. via @DataSourceDefinition), detecting JPA usage in the application (e.g. via entity manager injection) and auto-wiring/enabling a sensible persistence unit that the application can use as opposed to having an explicit persistence.xml for the "default case".

This particular convention can be potentially incorrect so we should weigh it carefully with community and expert group input. The problem is that as far as I have seen personally, developers often need to put in persistence.xml settings/properties for very common cases such as logging, debugging, caching and schema generation. This is particularly true during development and testing. This may mean that this particular convention may be a potential source of confusion instead of being helpful. Nonetheless, it is at least worth considering carefully and gathering feedback.

Please note that these are purely my personal views that may or may not reflect consensus at Oracle as a company.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.