-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add a property to define cache implementation in persistence.xml #32
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
So my thoughts on this issue are:
Let's consider what was already done in JPA 2.0:
In summary, the previous attempt at standardization was an almost-total failure. It was probably bound to fail, and in my opinion should probably have not been attempted. I guess I dropped the ball here by not paying closer attention to this part of JPA 2.0. I'm therefore not sure what would be gained by adding more second-level cache functionality to the spec, especially if it would again be something only applicable to certain JPA implementations. |
The cache implementation for the second level cache currently has to be configured via vendor specific properties but the semantics of the Cache are already reflected in the interface javax.persistence.Cache. The cache implementation should be configurable via persistence.xml.
I propose the property javax.persistence.cache.provider and the value of it should be the class name of the cache provider that actually implements javax.persistence.CacheProvider.
The CacheProvider interface could look similar to the RegionFactory interface hibernate actually uses.
Including the option to specify cache implementations in a stadardized way will improve the portability of applications and also make people to use the standard JPA provider of a container instead of packaging their own one in their applications.
The text was updated successfully, but these errors were encountered: