UnsupportedOperationException When Programmatically Overriding hibernate.ejb.cfgfile

Hi All -

I am trying to override the Hibernate config file 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.

So…am I doing this override correctly? Should that integrations map be unmodifiable if we later try to delete things from it?

Thanks for any insight,

Sounds like a bug. Please create a replicating test case and open a Jira issue.