I am migrating our app from wildfly 8.2.0.Final to 11.0.0.Final. We use JPA/Hibernate and Infinispan as cache provider. We have multiple mysql schemas and joins between tables on different schemas.
The new Infinispan/JPA/Hibnerate is giving me many Entity mapping and loading errors, the top 2:
First, if I have an entity mapping cache with region such as @Cache(region = "myRegion") and also have a collection entities with the same "myRegion", it does not work anymore in hibernate 5.1, I would have to change the collection cache to a different region name.
Second, got exception: "HibernateException: Found two representations of same collection".
These used to work fine in wildfly 8.2.
Because of these two show stoppers, we are thinking about downgrading hibernate in wildfly 11 to our current production version which is 4.3.
But I am not sure it is a feasible solution and how to do it. Also, not sure these problems are truly because of Hibernate or they could be because of Infinispan and JPA.
Any suggestions are welcome.
You can make your application use a different hibernate version and let the current version untouched.
See this post. Basically you add the hibernate library as a module and set the jboss.as.jpa.providerModule in persistence.xml