Skip to content

OpenJpaVendorAdapter missing from spring-orm [SPR-16035] #20584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Oct 2, 2017 · 8 comments
Closed
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: declined A suggestion or change that we don't feel we should currently apply

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 2, 2017

Francesco Chicchiriccò opened SPR-16035 and commented

I am upgrading Apache Syncope (in its master branch) from Spring 4.3.11.RELEASE to Spring 5.0.0.RELEASE and I have just found that the classes:

  • OpenJpaVendorAdapter
  • OpenJpaDialect

are barely missing from spring-orm.

When I just copy these two classes' sources from 4.3.x into Syncope sources, everything works as expected.


Affects: 5.0 GA

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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? 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).

@spring-projects-issues
Copy link
Collaborator Author

Francesco Chicchiriccò commented

FYI OpenJPA 3.0.0 was finally released: http://openjpa.apache.org/openjpa-3.0.x.html#OpenJPA-3.0.0

@spring-projects-issues spring-projects-issues added type: bug A general bug status: declined A suggestion or change that we don't feel we should currently apply in: data Issues in data modules (jdbc, orm, oxm, tx) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug A general bug label Jan 12, 2019
@bclozel
Copy link
Member

bclozel commented Jul 18, 2024

@powerbroker the latest OpenJPA source code seems to still contain integration tests for Spring. Can you elaborate what's missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

4 participants
@bclozel @jhoeller @spring-projects-issues and others