Conversation
2c14f0a to
9939b57
Compare
marko-bekhta
left a comment
There was a problem hiding this comment.
added a few questions inline 🙂
| Declares a container DataSource to be registered with JNDI. The | ||
| DataSource may be configured by setting the child elements for | ||
| commonly used DataSource properties. Additional standard and | ||
| vendor-specific properties may be specified using the properties | ||
| element. |
There was a problem hiding this comment.
what would happen if one passes any of the "predefined" properties through the properties element instead ?
There was a problem hiding this comment.
The exact same thing that happens as if you used @DataSrouceDefinition.
| If a DataSource property is specified in the properties element | ||
| and the annotation element for the property is also specified, | ||
| the annotation element value takes precedence. |
There was a problem hiding this comment.
oh right, so we have some precedence expectations here, should we add the case from above for the predefined property ?
There was a problem hiding this comment.
As I said: I am reallly trying hard not to diverge from existing semantics of things that already exist.
I am aware that the existing semantics probably kinda blow. But it would be worse to deviate from them.
| A JDBC URL. If the url annotation element contains a DataSource | ||
| property that was also specified using the corresponding | ||
| annotation element, the precedence order is undefined and | ||
| implementation specific. |
There was a problem hiding this comment.
implementation vs vendor specific -- if I understand you correctly here, implementation is about the Jakarta Persistence implementation and vendor is about the database behind the datasource, so maybe it's worth to be more specific here so there's no possible confusion 🙂
There was a problem hiding this comment.
if I understand you correctly here
It's not me you're trying to understand. I copy/pasted all that text verbatim.
| It may contain: | ||
|
|
||
| - any number of child `persistence-unit` elements, along with | ||
| - any number of child `data-source` elements. |
There was a problem hiding this comment.
the way the persistence element is defined (a sequence) it would mean that it's any number of datasources followed by any number of persistence units (since sequence does not allow random order of elements)
There was a problem hiding this comment.
Yeah actually I dislike how everything in persistence.xml has a defined order, even though no such natural order exists. The order is not semantically meaningful nor relevant.
| <xsd:complexType name="data-source-type"> | ||
| <xsd:annotation> | ||
| <xsd:documentation> | ||
| Declares a container DataSource to be registered with JNDI. The |
There was a problem hiding this comment.
I think this complex type is reused for top level and for the PU child element, and for the PU we later have
datasource may be declared as a child of the
persistence-unitelement, in
which case it may or may not be bound to JNDI
soo should we be saying that DataSource to be registered with JNDI ?
Co-authored-by: Marko Bekhta <marko-bekhta@users.noreply.github.com>
cf74f08 to
5e8de8b
Compare
|
For reasons explained in the issue, I have removed the proposal for a |
|
@scottmarlow @starksm64 @bstansberry I know we have already discussed this via email, but is there anything you would like to add here, or should I just move forward with this? @njr-11 Anything to say from the Liberty side? |
I'm not in favor of duplicating |
If we consider only Jakarta EE in isolation then I agree. The problem is that
That's entirely possible, but there's no guarantee that Jakarta Config—if and when it arrives—will actually address Java SE programs or be something that people will embrace for usage outside of the EE platform. (And it also implies an additional dependency.) |
This changeset realizes the idea proposed in #864, namely, that it should be possible to declare and configure a
DataSourcein thepersistence xmlfile.For example:
Or: