[hibernate-dev] Suggestions for alternative due to deprecation of Configuration access in ServiceContributor...

Scott Marlow smarlow at redhat.com
Wed May 23 08:51:54 EDT 2018


For the WildFly use of ServiceContributor [1], which registers for each 
SF/EMF, the 2lc RegionFactoryInitiator + JtaPlatform, I am worried that 
we don't yet have a "per app deployment" way to disable the WF 
ServiceContributorImpl.

I'm thinking that some applications (e.g. Spring) may not want to use 
the WF 2lc RegionFactoryInitiator + JtaPlatform classes.  To accomadate 
that need, I'm thinking of introducing WF configuration properties for 
controlling this:

* wildfly.jpa.jtaplatform will default to true but if set to false, [1] 
will not call serviceRegistryBuilder.addInitiator(new 
WildFlyCustomJtaPlatformInitiator()).

* wildfly.jpa.regionfactory will default to true but if set to false, 
[1] will not call serviceRegistryBuilder.addInitiator(new 
WildFlyCustomRegionFactoryInitiator()).

My request is that we keep the 
StandardServiceRegistryBuilder.getSettings() call and document that in 
the future, instead of removing it, we will change it to return a read 
only copy of the configuration settings.  Then, I can update [1] to 
check for these new properties and know that I can depend on using 
StandardServiceRegistryBuilder.getSettings().

An alternative could be to add a new method 
StandardServiceRegistryBuilder.getReadOnlySettings().

I'd like to make the WF code change now for WF13, so a quick response is 
appreciated! :)

Scott

[1] 
https://github.com/scottmarlow/wildfly/blob/WFLY-10427/jpa/hibernate5_3/src/main/java/org/jboss/as/jpa/hibernate5/service/ServiceContributorImpl.java#L30


More information about the hibernate-dev mailing list