作者:一个不需要幸福的男人丶 | 来源:互联网 | 2023-09-25 16:03
WehaveanappthatwearedevelopingandweareconsideringsupportingtwodifferentJPAimplementa
We have an app that we are developing and we are considering supporting two different JPA implementations.
我们正在开发一个应用程序,我们正在考虑支持两种不同的JPA实现。
At the moment we are using openjpa and have fairly well tested code.
目前我们正在使用openjpa并且拥有相当好的代码。
I swapped in toplink, ran the tests, and found a bunch of failures.
我交换了toplink,运行测试,发现了一堆失败。
You'd think that because JPA is a standard there shouldn't be any differences!
您认为因为JPA是一个标准,所以不应该有任何差异!
The rationale for supporting two JPA implementations is so that we can run on multiple app servers.
支持两个JPA实现的基本原理是我们可以在多个应用服务器上运行。
So 1stly, is it true that there is a one-to-one mapping between implementation and server. i.e. can I use toplink on WAS for example, or openjpa on Glassfish?
首先,在实现和服务器之间存在一对一的映射是否正确。即我可以在WAS上使用toplink,或者在Glassfish上使用openjpa吗?
The 2nd question before I investigate the various failures further is, the JPA spec, is it so broad as to make supporting two implementations impractical? Should I even bother trying to make the code work with both?
在我进一步调查各种失败之前的第二个问题是,JPA规范是否足以使支持两个实现变得不切实际?我是否应该费心去尝试使代码兼容?
3 个解决方案