Uploaded image for project: 'Hibernate ORM'
  1. HHH-13432

Have EntityManagerFactory expose persistence.xml `jta-data-source` element as a `javax.persistence.nonJtaDataSource` property

    Details

    • backPortable:
      Backport?
    • Last commented by a user?:
      true
    • Sprint:

      Description

      In Hibernate 4.3.x the following code would return a non-null DataSource:

      Object dataSource = entityManagerFactory.getProperties().get("javax.persistence.nonJtaDataSource");
      

      In Hibernate 5 this no longer appears to work. The EntityManagerFactoryBuilderImpl contains the following line which seems to suggest that the property should be exposed but, as far as I can tell, the configurationValues are no longer copied to the EntityManagerFactory properties. I wonder if instead ssrBuilder.applySetting should now be used?

      This issue was originally identified by a Spring Boot user and more background can be found here. The user has also attached a project that replicates the issue when FirstDbConfig and SecondDbConfig are edited to remove his workaround.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: