We're updating the issue view to help you get more done. 

EntityManagerFactory no longer exposes "javax.persistence.nonJtaDataSource"

Description

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

1 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.

Environment

None

Status

Assignee

Unassigned

Reporter

Phillip Webb

Worked in

4.3.11

Components

Affects versions

5.4.3

Priority

Minor