Re: [hibernate-dev] Is there a way to have ServiceContributor per SessionFactory/EMF instead of per application classloader?

2018-09-19 Thread Steve Ebersole
StandardServiceRegistry`No, it's not. Each call to `registry.getService( RegionFactory.class )` in your test returns the same `RegionFactory` - by design. By default each SF bootstrap uses a unique StandardServiceRegistry which is what the ServiceContributor contributes services to. In terms of

Re: [hibernate-dev] Is there a way to have ServiceContributor per SessionFactory/EMF instead of per application classloader?

2018-09-19 Thread Scott Marlow
Please look at https://github.com/scottmarlow/hibernate-orm/tree/ServiceContributorTest and let me know if this is a valid test. I added a test that calls registry.getService( RegionFactory.class ) twice and fails if the RegionFactoryInitiator doesn't get called twice. Is that the same as cre

Re: [hibernate-dev] Is there a way to have ServiceContributor per SessionFactory/EMF instead of per application classloader?

2018-09-19 Thread Scott Marlow
On 9/19/18 9:22 AM, Steve Ebersole wrote: > Ohhh... Sorry I misunderstood.  I thought you were asking about ways to > have the contributor only apply to one of the PUs... > > I'm surprised it isn't applied to each actually.  I'd consider that a > bug.  Can you put together a test? Yes, I will

Re: [hibernate-dev] Is there a way to have ServiceContributor per SessionFactory/EMF instead of per application classloader?

2018-09-19 Thread Steve Ebersole
Ohhh... Sorry I misunderstood. I thought you were asking about ways to have the contributor only apply to one of the PUs... I'm surprised it isn't applied to each actually. I'd consider that a bug. Can you put together a test? On Wed, Sep 19, 2018, 8:12 AM Scott Marlow wrote: > > > On 9/19/1

Re: [hibernate-dev] Loggers

2018-09-19 Thread Steve Ebersole
Yes. As I mentioned in my original, this would mean potential changes for people configuring logging. I've started doing this for new logging in 6 and it works great. Mainly asking opinions about changing existing logging and whether the benefits are worth the effort. And keep in mind that the

Re: [hibernate-dev] Is there a way to have ServiceContributor per SessionFactory/EMF instead of per application classloader?

2018-09-19 Thread Scott Marlow
On 9/19/18 5:41 AM, Gunnar Morling wrote: > Would SessionFactoryServiceContributor [1] be of use to you? It lets you > add services to the SF-scoped service registry; not sure whether that > suits your requirements or no. Thanks, I will give that a try. We currently use RegionFactoryInitiator

Re: [hibernate-dev] Is there a way to have ServiceContributor per SessionFactory/EMF instead of per application classloader?

2018-09-19 Thread Gunnar Morling
Would SessionFactoryServiceContributor [1] be of use to you? It lets you add services to the SF-scoped service registry; not sure whether that suits your requirements or no. --Gunnar [1] https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/service/spi/