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

UnsupportedOperationException when programmatically overriding hibernate.ejb.cfgfile

Description

I am trying to programmatically override the Hibernate config file setting in persistence.xml by passing in a Properties object to Persistence.createEntityManagerFactory. In that Properties object, I set the “hibernate.ejb.cfgfile” property.

When I do, I get an UnsupportedOperationException down in org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.mergeSettings().

It looks like line 483 (I am using version 5.4.0.Final) in that file is trying to remove the CFG_FILE property from an unmodifiable map that was created back on line 78 of org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull() by a call to wrap.

Environment

Hibernate 5.4.0, Oracle JDK 10.0.2, MacOS, MySQL 5.7

Status

Assignee

Vlad Mihalcea

Reporter

John Casebolt

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.4.0

Priority

Minor