[hibernate-dev] Persistence.xml properties are not available when the Hibernate services are bootstrapped

Mihalcea Vlad mih_vlad at yahoo.com
Mon Jun 8 09:25:53 EDT 2015


Hi Steven,
I'm trying to integrate FlexyPool ( https://github.com/vladmihalcea/flexy-pool ) with Java EE Application servers, and the only work-around I found is to add a new Hibernate ConnectionProvider that extends the DataSourceConnectionProvider and exposes a DataSource proxy, instead of the original Application server one. This can allow monitoring connection allocation.
The persistence.xml properties (transaction-type, jta or non-jta data source) are not available in the properties Map supplied to the Configurable interface I'm also implementing.
I checked the org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl source code and found this comment:// HHH-8121 : make the PU-defined value available to EMF.getProperties()
configurationValues.put( AvailableSettings.JTA_DATASOURCE, persistenceUnit.getJtaDataSource() );This Hibernate issues is closed: 

https://hibernate.atlassian.net/browse/HHH-8122 But the properties are still missing in the properties Map supplied to the Configurable interface. Without this info, it's very hard to decide whether my implementation should support aggressive release (for JTA) or not (RESOURCE_LOCAL).
Do you know anything about it?

Vlad


More information about the hibernate-dev mailing list