You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenJpaVendorAdapter missing from spring-orm [SPR-16035] #20584
I'm afraid we do not support OpenJPA anymore, at least not with such special adapter code. The reason is simply that OpenJPA is lagging far behind and hasn't even managed to release a JPA 2.1 compatible version yet. Since Spring Framework 5.0 requires JPA 2.1+, with dedicated support for JPA 2.2 already, OpenJPA is also not guaranteed to work at runtime either.
So from the perspective of Apache Syncope, you'd have to double-check whether OpenJPA actually works in a user project for you. It might work in your test setup where a separately provided JPA 2.1 API jar is present, but with a plain OpenJPA distribution, it's likely going to fail with Spring Framework 5.0 due to some JPA NoClassDefFoundError.
The Apache OpenJPA PMC (which I am also member of) is currently committed to OpenJPA 3.0.0, which will be Java 8 and JPA 2.2 compliant.
The current trunk code (available as 3.0.0-SNAPSHOT) is the one we are using in Apache Syncope 2.1.0-SNAPSHOT (master branch).
FYI I have backported the missing classes in apache/syncope@17a8eb5 - at least all of our unit and integration tests work fine with OpenJPA 3.0.0-SNAPSHOT and Spring 5.
Alright, thumbs up for finally making OpenJPA 3.0 happen! I don't see why it wouldn't work with Spring's general JPA support either once it's on JPA 2.1+, so your current solution seems totally ok there. Are you actually using any of the 'special' features in OpenJpaVendorAdapter? JDBC Connection retrieval maybe? Otherwise a standard Spring JPA setup would work just fine, which is why I'm asking.
What about shipping OpenJpaVendorAdapter with OpenJPA 3.0 itself? That way you would tightly align its release cycle and be able to adapt it to any OpenJPA API changes, and do integration tests against it... This wouldn't be unusual either since we have plenty of third-party frameworks shipping Spring adapters these days, e.g. Mybatis and Thymeleaf. Also, Spring's JpaVendorAdapter contract has been very stable for 10+ years now.
In general, we're trying to reduce third-party adapters in the core Spring distribution to two 'reference' implementations per case - validating our abstractions but not aiming for completeness there: e.g. Hibernate + EclipseLink for special JPA features, FreeMarker + Groovy for template rendering, etc. Note that we do not ship a DataNucleus adapter, and as mentioned no Thymeleaf adapter either (despite it being more popular than FreeMarker these days).
Activity
spring-projects-issues commentedon Oct 2, 2017
Juergen Hoeller commented
I'm afraid we do not support OpenJPA anymore, at least not with such special adapter code. The reason is simply that OpenJPA is lagging far behind and hasn't even managed to release a JPA 2.1 compatible version yet. Since Spring Framework 5.0 requires JPA 2.1+, with dedicated support for JPA 2.2 already, OpenJPA is also not guaranteed to work at runtime either.
So from the perspective of Apache Syncope, you'd have to double-check whether OpenJPA actually works in a user project for you. It might work in your test setup where a separately provided JPA 2.1 API jar is present, but with a plain OpenJPA distribution, it's likely going to fail with Spring Framework 5.0 due to some JPA
NoClassDefFoundError.spring-projects-issues commentedon Oct 2, 2017
Francesco Chicchiriccò commented
Thanks for your answer.
The Apache OpenJPA PMC (which I am also member of) is currently committed to OpenJPA 3.0.0, which will be Java 8 and JPA 2.2 compliant.
The current trunk code (available as 3.0.0-SNAPSHOT) is the one we are using in Apache Syncope 2.1.0-SNAPSHOT (master branch).
spring-projects-issues commentedon Oct 2, 2017
Francesco Chicchiriccò commented
FYI I have backported the missing classes in apache/syncope@17a8eb5 - at least all of our unit and integration tests work fine with OpenJPA 3.0.0-SNAPSHOT and Spring 5.
spring-projects-issues commentedon Oct 2, 2017
Juergen Hoeller commented
Alright, thumbs up for finally making OpenJPA 3.0 happen! I don't see why it wouldn't work with Spring's general JPA support either once it's on JPA 2.1+, so your current solution seems totally ok there. Are you actually using any of the 'special' features in
OpenJpaVendorAdapter? JDBCConnectionretrieval maybe? Otherwise a standard Spring JPA setup would work just fine, which is why I'm asking.What about shipping
OpenJpaVendorAdapterwith OpenJPA 3.0 itself? That way you would tightly align its release cycle and be able to adapt it to any OpenJPA API changes, and do integration tests against it... This wouldn't be unusual either since we have plenty of third-party frameworks shipping Spring adapters these days, e.g. Mybatis and Thymeleaf. Also, Spring'sJpaVendorAdaptercontract has been very stable for 10+ years now.In general, we're trying to reduce third-party adapters in the core Spring distribution to two 'reference' implementations per case - validating our abstractions but not aiming for completeness there: e.g. Hibernate + EclipseLink for special JPA features, FreeMarker + Groovy for template rendering, etc. Note that we do not ship a DataNucleus adapter, and as mentioned no Thymeleaf adapter either (despite it being more popular than FreeMarker these days).
spring-projects-issues commentedon Jun 14, 2018
Francesco Chicchiriccò commented
FYI OpenJPA 3.0.0 was finally released: http://openjpa.apache.org/openjpa-3.0.x.html#OpenJPA-3.0.0
bclozel commentedon Jul 18, 2024
@powerbroker the latest OpenJPA source code seems to still contain integration tests for Spring. Can you elaborate what's missing?