|Eclipselink v1 API and eclipselink JPA co-existence? [message #1723225]
||Fri, 12 February 2016 15:21
| Thom Park
Registered: June 2012
Allow me to explain. We have to applications, an old monolithic one that uses the old "toplink" v1 API. The other newer application, we'd like to use eclipselink JPA.|
We have one challenge however, these applications 'talk' to the same database schema and we'd like to share a common cache across the instances of the two apps to avoid having to force an object refresh on every access to pick up any updates performed by the other application.
Currently we use cache-coordination -but that would mean our newer applications have to use the old API (since lazy loading isn't transparent with the old API - ValueHolderInterfaces abound!)
Reading the documentation, I see that in the newer JPA annotations-based API, though the entity isn't defined as having Valueholders in the java class definitions, I see that they are still employed and 'weaved in' at runtime. That gives me pause for thought.
If I were to define a JPA based entity with lazy-loaded one-to-many relationships, what would the object in the entity cache look like? Would it have a ValueHolder implementation as a placeholder or would it have the java collection as defined in the original class file ?
Where am I going with this?
The two applications are accessing exactly the same data in the database, both are mapped to the same schema so the source data is the same, I'm trying to understand what would happen if a class from the JPA world was merged into the cache of the v1 API world - both classes would have the same full name (com.foo.bar.MyEntity say) and would have the same id, but would have a subtly different shape - would I be facing a disaster?
Of course, I could use cache invalidation as my cache coordination scheme - in that case, I'd assume that there wouldn't be a problem with the caches holding different objects, since I'd never try to merge the 'JPA' class into the 'v1API' class.
Sorry to ramble - Does anyone know how the weaved in Valueholder manifests itself in the cache? Opinions?
[Updated on: Fri, 12 February 2016 15:24]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01986 seconds