We upgraded from Open JPA -2.4.3 with Spring 4.3.19.RELEASE to Hibernate- 5.4.8.Final with Spring-5.2.6.RELEASE. We had to change ORM provider since spring 5.0 and related Spring Data did not have an OpenJPA vendor adapter. Upgrade caused Performance issues for our Batch Jobs, they were running 10 times slower than before. We finally ended up migrating the non performing queries to Native SQL Queries. From performance dumps it Sessions are not being released after the transaction is committed in Hibernate Question:
Has anyone encounter similar issues and how they resolved it?
One side note, not sure whether its related or not: we have observed is OpenJPA is using OpenJpa is using WeakHashMap and Hibernate is using Concurrent Hashmap.
[1]: https://i.stack.imgur.com/4hE3V.png - Using OpenJPA
[2]: https://i.stack.imgur.com/sXRiw.png - Using Hiberate