Hello Devs, I have started this thread to discuss the JPA implementation to adopt as we work towards making Fineract CN Apache compliant as well as to ensure that we are all aligned as a community.
I am currently working on the migration to OpenJPA as my GSoC project. However, a number of red flags as well and requests from other community members has made it critical to start this thread. As most of you know, we can't use Hibernate as it's not compliant therefore, it's essential that we migrate to an equally good ORM. *Our options:* 1. EclipseLink - EPL 1.0 & BSD 2. OpenJPA - Apache 2.0 3. DataNucleus - Apache 2.0 Not recommended 4. iBatic - Apache 2.0 (still functional but retired https://ibatis.apache.org/) 5. TopLink - CDDL (category B license, and simply extend EclipseLink) I used the following criteria in the following order of priority. 1. License 2. Implementation's performance with respect to PostgreSQL 3. Support in Spring as well as ORM Documentation 4. Project Maturity Right off the bat, I suggest the adoption of EclipseLink <https://wiki.eclipse.org/EclipseLink> based on new insights discovered, re-evaluation of our options, and compatibility issues discovered whiles migrating to OpenJPA. *Why EclipseLink? * According to JPA Performance benchmark - http://www.jpab.org/All/All/All.html EclipseLink is the Most Efficient ORM (amongst our valid options) when persisting to PostgreSQL and even outperforming Hibernate. Performance Summary (with respect to Postgres) EclipseLink - 10.5 Hibernate - 9.1 OpenJPA - 6.5 DataNucleus - 6.0 *Issues with OpenJPA.* 1. Spring dropped support back in 2017 and requests to resume support was declined earlier this year https://github.com/spring-projects/spring-framework/issues/20584. There is no guarantee when it will be back in newer versions of Spring. Spring 5 for instance no longer includes the OpenJpaVendorAdaptor. Therefore, future upgrade of Fineract CN will become an issue. 2. OpenJPA has been lagging behind - the stable version for spring supports up to JDK 1.6 (although v3.0.0+ is working to resolve this issue). 3. Bugs and compatibility issues with other libraries. I have first-hand experience with it and it's not pleasant. *Why not DataNucleus?* It is not supported in Spring 4.x and its implementation will require us to completely heavily refactor the JPA Layer in Fineract CN on top of that, it's the slowest. Looking forward to your recommendations and your own evaluations. -- *Regards*
