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

Scott Marlow smarlow at redhat.com
Tue Sep 18 14:43:32 EDT 2018



On 9/14/18 6:15 PM, Steve Ebersole wrote:
> Another thought.  If you are specifically talking about JPA container 
> integration we could always accept ServiceContributor(s) via the 
> integration values Map.

This is for both JPA container integration and not container integration.

> 
> On Fri, Sep 14, 2018 at 10:14 PM Steve Ebersole <steve at hibernate.org 
> <mailto:steve at hibernate.org>> wrote:
> 
>     Doing so would require a programatic call while bootstrapping
>     Hibernate.  The ServiceContributors are applied during
>     `org.hibernate.boot.registry.StandardServiceRegistryBuilder#build`
>     processing.  So we'd need a call to register a ServiceContributor
>     with the StandardServiceRegistryBuilder.
> 
>     Of course that also means you'd have to have access to the
>     StandardServiceRegistryBuilder
> 
>     On Fri, Sep 14, 2018 at 9:27 PM Scott Marlow <smarlow at redhat.com
>     <mailto:smarlow at redhat.com>> wrote:
> 
>         I'm deploying an application with two persistence units however,
>         the
>         ServiceContributor contribute(StandardServiceRegistryBuilder)
>         [1] is
>         only being called once, instead of per SessionFactory/EMF (or so
>         it seems).
> 
>         Is there a way to have the
>         contribute(StandardServiceRegistryBuilder) be
>         called per SessionFactory/EMF instead?
> 
>         Scott
> 
>         [1]
>         https://github.com/wildfly/wildfly/blob/master/jpa/hibernate5_3/src/main/java/org/jboss/as/jpa/hibernate5/service/ServiceContributorImpl.java#L28
>         _______________________________________________
>         hibernate-dev mailing list
>         hibernate-dev at lists.jboss.org <mailto:hibernate-dev at lists.jboss.org>
>         https://lists.jboss.org/mailman/listinfo/hibernate-dev
> 


More information about the hibernate-dev mailing list