Skip to main content

[javaee-spec issues] [JIRA] Commented: (JAVAEE_SPEC-30) JPA persistence.xml should integrate with @DataSourceDefinition and web.xml data-source definition

  • From: "lincolnbaxter (JIRA)" <jira-no-reply@...>
  • To: issues@...
  • Subject: [javaee-spec issues] [JIRA] Commented: (JAVAEE_SPEC-30) JPA persistence.xml should integrate with @DataSourceDefinition and web.xml data-source definition
  • Date: Thu, 10 Apr 2014 15:30:49 +0000 (UTC)
  • Auto-submitted: auto-generated


    [ 
https://java.net/jira/browse/JAVAEE_SPEC-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=374279#action_374279
 ] 

lincolnbaxter commented on JAVAEE_SPEC-30:
------------------------------------------

When speaking to the various people in charge of JPA integration in these 
servers, I got the overall impression that they did not believe the spec 
required this, which is why it does not work on most servers. Thus I moved to 
file a spec issue that would cause people to do the right thing :)

> JPA persistence.xml should integrate with @DataSourceDefinition and web.xml 
> data-source definition
> --------------------------------------------------------------------------------------------------
>
>                 Key: JAVAEE_SPEC-30
>                 URL: https://java.net/jira/browse/JAVAEE_SPEC-30
>             Project: javaee-spec
>          Issue Type: Improvement
>         Environment: EE 6/7+
>            Reporter: lincolnbaxter
>            Assignee: ldemichiel
>
> Datasources defined via @DataSourceDefinition allow @Resource injection of 
> DataSource objects into application code. However, these data-sources are 
> not integrated with the persistence.xml JPA configuration file. And 
> attempted use of the custom defined DataSource in persistence.xml will 
> result in deployment failure. The EE spec allow for interop between these 
> features:
> For a datasource definition:
> {code}
> @DataSourceDefinition(
>          url = "jdbc:h2:mem:",
>          className = "org.h2.jdbcx.JdbcDataSource",
>          name = "java:global/jdbc/h2db",
>          user = "sa",
>          password = "")
> {code}
> The following persistence.xml should be valid:
> {code}
> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" ;
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence ;
> http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/persistence_2_1.xsd";>
>    <persistence-unit name="default" transaction-type="JTA">
>       <jta-data-source>java:global/jdbc/h2db</jta-data-source>
>       <exclude-unlisted-classes>false</exclude-unlisted-classes>
>    </persistence-unit>
> </persistence>
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[javaee-spec issues] [JIRA] Commented: (JAVAEE_SPEC-30) JPA persistence.xml should integrate with @DataSourceDefinition and web.xml data-source definition

lincolnbaxter (JIRA) 04/10/2014

<Possible follow-up(s)>

[javaee-spec issues] [JIRA] Commented: (JAVAEE_SPEC-30) JPA persistence.xml should integrate with @DataSourceDefinition and web.xml data-source definition

ldemichiel (JIRA) 04/15/2014
 
 
Close
loading
Please Confirm
Close