1

We are using a Wildfly application server and are currently migrating from 8.2.0 to 10.1.0.

With WildFly 8.2 (Hibernate 4.3) we could install a global Interceptor for all Sessions using a Hibernate Integrator.

public class MyIntegrator implements Integrator {
    private static Logger logger = Logger.getLogger(MyIntegrator.class);

    @Override
    public void integrate(Configuration configuration, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
        logger.info("Install GlobalInterceptor in " + configuration.getProperty("hibernate.session_factory_name"));
        configuration.setInterceptor(new GlobalInterceptor());
    }

    ...
}

This does not work anymore with Wildfly 10.1 (Hibernate 5) since the API has changed. Instead of the Configuration Hibernate now passes a Metadata instance into integrate.

I couldn't find any information on this in the migration guides.

Thank you for any hints!

christoph.keimel
  • 1,240
  • 10
  • 24

0 Answers0