<div dir="ltr">I am just not sure a lot of this is true. What EntityManagerFactoryBuilder (the proprietary Hibernate 2-Phase JPA bootstrap SPI) contracts changed in 5.0?<div><br></div><div>As for Jandex version, 5.0 is not using Jandex. We accept a IndexView, but we currently do not use it. So that actually should also not cause any issues in regards to Hibernate 4.x or 5.0</div><div><br></div><div>As far as using the standard JPA bootstrap SPIs, I agree this is up to Scott. But it simply will not work for the way WildFly does stuff as I understand it.</div><div><br></div><div>Second-level cache, yes, is a whole other ball of wax :)</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 28, 2015 at 9:18 AM, Jason Greene <span dir="ltr"><<a href="mailto:jason.greene@redhat.com" target="_blank">jason.greene@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We implement the standard JPA integration SPI, but it is absolutely awful.<br>
<br>
It forces:<br>
<br>
- The construction of duplicate class loaders with duplicate class definitions of every class in the deployment<br>
- Repeated runs of the deployment process<br>
- Double loading of any class related to JPA (and its dependencies)<br>
- The JPA provider to use reflection for all annotation discovery<br>
- Double use of reflection in the deployment process<br>
- Bugs from chicken and egg problems<br>
- Increased memory usage<br>
<br>
So for this reason WildFly and Hibernate have their own integration SPIs, and those SPIs are changing in hibernate 5. So WildFly (well currently JIPPAJAPPA) needs an update to be compatible with them. Additionally we have the Jandex 2 change which is pending that both projects are attempting to align on.<br>
<br>
Now what I am not sure about, Scott will have to answer this. Is if you can use the standard JPA integration SPI with newer versions of Hibernate and just live with the nastiness it brings.<br>
<br>
However, there is still a secondary issue, which I am sure you already know about is that the second level cache and hibernate search have integrations that need to be compatible and in sync and tested.<br>
<div><div class="h5"><br>
> On May 28, 2015, at 5:30 AM, Sanne Grinovero <<a href="mailto:sanne@hibernate.org">sanne@hibernate.org</a>> wrote:<br>
><br>
> Could someone explain please, why it's hard to have a deployer just<br>
> use a different JPA implementor which the user might want to provide?<br>
><br>
> I'm pretty sure I know how to start a JPA context in plain JavaSE, and<br>
> don't need to know which implementor version I'm going to use, other<br>
> than for sake of configuration.<br>
><br>
> The WildFly documentation mentions this property<br>
> "jboss.as.jpa.providerModule", which sounds great on paper and it<br>
> would be a nice usability improvement if it would also actually work<br>
> as it suggests.<br>
><br>
> There's plenty of evidence on StackOverflow that the current<br>
> limitations are unexpected. For example, Spring moved to Hibernate 5<br>
> and people won't be able to use your stable line of the application<br>
> server with Spring; I'd hope we could implement a plan to prevent this<br>
> from happening at the next upgrade cycles.<br>
><br>
> Thanks,<br>
> Sanne<br>
><br>
> On 21 May 2015 at 20:10, Scott Marlow <<a href="mailto:smarlow@redhat.com">smarlow@redhat.com</a>> wrote:<br>
>><br>
>><br>
>> On 05/21/2015 03:05 PM, Tomaž Cerar wrote:<br>
>>> Scott,<br>
>>><br>
>>> if you do one last jipijapa release that adds "support" for hibernate5<br>
>>> hibernate guys could take that version and override it in wildfly 9 same<br>
>>> way as they add new h5 modules.<br>
>><br>
>> I assume this will be an iterative process but sure, we could also push<br>
>> a release of the JIPI-31 branch. Lets keep talking about what is needed...<br>
>><br>
>>><br>
>>> --<br>
>>> tomaz<br>
>>><br>
>>> On Thu, May 21, 2015 at 9:01 PM, Scott Marlow <<a href="mailto:smarlow@redhat.com">smarlow@redhat.com</a><br>
>>> <mailto:<a href="mailto:smarlow@redhat.com">smarlow@redhat.com</a>>> wrote:<br>
>>><br>
>>> On 05/21/2015 02:11 PM, Emmanuel Bernard wrote:<br>
>>>> Scott, No way to make ORM 5 work in 9 at all? With the user setting the additional slotted modules of course.<br>
>>><br>
>>> <a href="https://github.com/scottmarlow/jipijapa/tree/JIPI-31" target="_blank">https://github.com/scottmarlow/jipijapa/tree/JIPI-31</a> contains the<br>
>>> integration code that we will look at merging into WildFly 10. Are you<br>
>>> looking for a custom WildFly 9.x branch or actual changes in WildFly 9<br>
>>> (doesn't seem as likely to me but I don't control the schedule)?<br>
>>><br>
>>>><br>
>>>> It would help speed up the Hibernate 5 stream adoption and avoid<br>
>>> a lot of duplicated work for 6+ months.<br>
>>>><br>
>>>>> On 21 mai 2015, at 16:36, Scott Marlow <<a href="mailto:smarlow@redhat.com">smarlow@redhat.com</a><br>
>>> <mailto:<a href="mailto:smarlow@redhat.com">smarlow@redhat.com</a>>> wrote:<br>
>>>>><br>
>>>>> Hibernate ORM 5.0 doesn't work yet on WildFly. Will push on<br>
>>> this soon<br>
>>>>> for WildFly 10.<br>
>>>>><br>
>>>>>> On 05/21/2015 07:30 AM, Sanne Grinovero wrote:<br>
>>>>>> Hi all,<br>
>>>>>> I'm attempting to deploy some integration tests on WildFly<br>
>>> 9.0.0.CR1<br>
>>>>>> to use a preview of Hibernate ORM version 5.<br>
>>>>>><br>
>>>>>> It seems the JPA deployer isn't allowing me to run such<br>
>>> experiments:<br>
>>>>>><br>
>>>>>> # First experiment - providerModule set to custom module<br>
>>>>>><br>
>>>>>> In my first attempt, I create a custom set of jboss modules which<br>
>>>>>> include the snapshot builds of ORM 5, add them to my standalone WF9<br>
>>>>>> instance and set the persistence.xml property:<br>
>>>>>> jboss.as.jpa.providerModule = my-custom-module-name<br>
>>>>>><br>
>>>>>> and then get:<br>
>>>>>><br>
>>>>>> Caused by: java.util.ServiceConfigurationError:<br>
>>>>>> org.hibernate.integrator.spi.Integrator: Provider<br>
>>>>>> org.hibernate.envers.boot.internal.EnversIntegrator not a subtype<br>
>>>>>> at java.util.ServiceLoader.fail(ServiceLoader.java:231)<br>
>>> [rt.jar:1.7.0_51]<br>
>>>>>> at java.util.ServiceLoader.access$300(ServiceLoader.java:181)<br>
>>> [rt.jar:1.7.0_51]<br>
>>>>>> at<br>
>>> java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:369)<br>
>>>>>> [rt.jar:1.7.0_51]<br>
>>>>>> at java.util.ServiceLoader$1.next(ServiceLoader.java:445)<br>
>>> [rt.jar:1.7.0_51]<br>
>>>>>> at<br>
>>> org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:341)<br>
>>>>>> at<br>
>>> org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(IntegratorServiceImpl.java:57)<br>
>>>>>> at<br>
>>> org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:247)<br>
>>>>>> at<br>
>>> org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:520)<br>
>>>>>> at<br>
>>> org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:208)<br>
>>>>>> at<br>
>>> org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:188)<br>
>>>>>> at<br>
>>> org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:45)<br>
>>>>>> at<br>
>>> org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:57)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.<init>(TwoPhaseBootstrapImpl.java:38)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.hibernate4.HibernatePersistenceProviderAdaptor.getBootstrap(HibernatePersistenceProviderAdaptor.java:173)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl.createContainerEntityManagerFactoryBuilder(PhaseOnePersistenceUnitServiceImpl.java:243)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl.access$800(PhaseOnePersistenceUnitServiceImpl.java:60)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1$1.run(PhaseOnePersistenceUnitServiceImpl.java:118)<br>
>>>>>> ... 7 more<br>
>>>>>><br>
>>>>>> Clearly it looks like I'm being served classes from the bundled<br>
>>>>>> Hibernate 4.x implementation - on top of those from the module I'm<br>
>>>>>> requesting. This isn't what the deployer should be doing, right?<br>
>>>>>><br>
>>>>>> # Second experiment - use the "application provided"<br>
>>>>>><br>
>>>>>> In this case I hope to hint the JPA deployer to not add the<br>
>>> default<br>
>>>>>> implementor but look for a JPA implementation within my deployment,<br>
>>>>>> but still package my custom Hibernate build as a module.<br>
>>>>>><br>
>>>>>> - use the same custom module containing Hibernate ORM 5 (a<br>
>>> preview snapshot)<br>
>>>>>> - Add a "Dependency:" section to the manifest to import (and<br>
>>> export)<br>
>>>>>> my custom module<br>
>>>>>> - set the "jboss.as.jpa.providerModule" property to value<br>
>>> "application"<br>
>>>>>><br>
>>>>>> This gets me:<br>
>>>>>><br>
>>>>>> Caused by:<br>
>>> org.jboss.as.server.deployment.DeploymentUnitProcessingException:<br>
>>>>>> WFLYJPA0027: Persistence provider module load error application<br>
>>> (class<br>
>>>>>> org.hibernate.jpa.HibernatePersistenceProvider)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:985)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:267)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleWarDeployment(PersistenceUnitServiceHandler.java:200)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:131)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)<br>
>>>>>> at<br>
>>> org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156)<br>
>>>>>> [wildfly-server-1.0.0.CR1.jar:1.0.0.CR1]<br>
>>>>>> ... 5 more<br>
>>>>>> Caused by: org.jboss.modules.ModuleNotFoundException:<br>
>>> application:main<br>
>>>>>> at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:236)<br>
>>>>>> [jboss-modules.jar:1.4.3.Final]<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.persistenceprovider.PersistenceProviderLoader.loadProviderModuleByName(PersistenceProviderLoader.java:65)<br>
>>>>>> at<br>
>>> org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:978)<br>
>>>>>> ... 10 more<br>
>>>>>><br>
>>>>>> Remarks:<br>
>>>>>> - it's attempting to load the "application:main" module?!<br>
>>> that's not<br>
>>>>>> what I'd expect from reading [1]<br>
>>>>><br>
>>>>> This seems to be a bug. I hit it a few days ago when I packaged<br>
>>>>> Hibernate ORM 4.1.x with an application (in a unit test) and<br>
>>> forgot to<br>
>>>>> set the persistence provider in persistence.xml.<br>
>>>>><br>
>>>>>> - the provider should be available to the deployment<br>
>>> classpath, so<br>
>>>>>> I'm not sure why it's not finding the Provider? (I'm even exporting<br>
>>>>>> it, although I'm not sure if that was required).<br>
>>>>><br>
>>>>> Providers are always found through the<br>
>>>>> javax.persistence.spi.PersistenceProviderResolver, not directly<br>
>>> from the<br>
>>>>> deployment classpath.<br>
>>>>><br>
>>>>>><br>
>>>>>> Any suggestions to get this running please?<br>
>>>>>><br>
>>>>>> Also I wonder if some of these should warrant opening a JIRA,<br>
>>> but I'm<br>
>>>>>> not sure how far I misunderstood the intentions of these JPA<br>
>>> deployer<br>
>>>>>> properties.<br>
>>>>><br>
>>>>> Lets talk in a few days again on IRC.<br>
>>>>><br>
>>>>>><br>
>>>>>> Thanks,<br>
>>>>>> Sanne<br>
>>>>>><br>
>>>>>> [1] -<br>
>>> <a href="https://docs.jboss.org/author/display/WFLY9/JPA+Reference+Guide#JPAReferenceGuide-Persistenceunitproperties" target="_blank">https://docs.jboss.org/author/display/WFLY9/JPA+Reference+Guide#JPAReferenceGuide-Persistenceunitproperties</a><br>
>>>>> _______________________________________________<br>
>>>>> wildfly-dev mailing list<br>
>>>>> <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a> <mailto:<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>><br>
>>>>> <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
>>> _______________________________________________<br>
>>> wildfly-dev mailing list<br>
>>> <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a> <mailto:<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>><br>
>>> <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
>>><br>
>>><br>
>> _______________________________________________<br>
>> wildfly-dev mailing list<br>
>> <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
><br>
> _______________________________________________<br>
> wildfly-dev mailing list<br>
> <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
<br>
</div></div>--<br>
Jason T. Greene<br>
WildFly Lead / JBoss EAP Platform Architect<br>
JBoss, a division of Red Hat<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a></div></div></blockquote></div><br></div>