[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-dev] Check-in : Bug 232063 - Relationships between JPA 2.0 Cachable(false) and Cachable(true) Entities should be supported
|
Hello Adrian,
If you have feedback on how the design doc could be better please add
that feedback to the wiki discussion page:
http://wiki.eclipse.org/Talk:EclipseLink/DesignDocs/232063
My answers can be found inline below.
--Gordon
Goerler, Adrian wrote:
Hi Gordon,
great that you are working on this issue! I am looking forward to try this it out.
Just, I am wondering how you are tackling relationships between cached and non-cached entities and what the intended semantics are. For single-valued relationships, I see different options:
1) Cache the id of the related entities but not the related entities themselves.
2) Establish all relationship once the entities are read from the cache.
I think 1) would be preferable if the cached entity is the owning side of the relationship. I am unsure about the case when the cached entity is the non-owning side.
The FK values that EclipseLink needs for the relationship queries are
cached in the CacheKey. So for a non-owned one to one mapping this
would be the PK of the Entity, for a standard FK relationship this would
be the FK value from this Entities row.
What about collection-valued relationships? Will the ids of the related entities be cached?
No, just FK data.
What about relationships between read-only and mutable entities. (I think no read-only entity should be allowed to have a relationship to a mutable one).
EclipseLink's semantics of read-only and mutability are not directly
affected by this feature and currently within EclipseLink when using the
"read-only" query hint the entire Entity tree returned by the query will
be "read-only" and unmanaged.
The design doc http://wiki.eclipse.org/EclipseLink/DesignDocs/232063 doesn't answer this for me.
Or are you just switching of the cache for an entity if it has a reference to a non-cacheable entity:
"When an entity with @Cacheable(true) has a relationship to an entity with @Cacheable(false) or an @Cacheable(true) entity has a @NonCacheable relationship we will default to and only allow the Entity to be @Cacheable(false)"
No this line in the doc was incorrect. Only the noncacheable
relationships are not cached for @Cacheable Entities. The Entity data
and other cacheable relationships continue to be cached.
-Adrian
Adrian Görler
SAP AG
Pflichtangaben/Mandatory Disclosure Statements:
http://www.sap.com/company/legal/impressum.epx
-----Original Message-----
From: eclipselink-dev-bounces@xxxxxxxxxxx [mailto:eclipselink-dev-bounces@xxxxxxxxxxx] On Behalf Of Gordon Yorke
Sent: Dienstag, 30. November 2010 03:52
To: Dev mailing list for Eclipse Persistence Services
Subject: [eclipselink-dev] Check-in : Bug 232063 - Relationships between JPA 2.0 Cachable(false) and Cachable(true) Entities should be supported
https://bugs.eclipse.org/bugs/show_bug.cgi?id=232063
Allows for referencing isolated data from shared data.
Allows Entity class to be marked as protected isolation so that queries
returning shared data results that are not returning shared cache instances
More check-ins to come to cover off on JavaDoc updates and extensive
testing.
--Gordon
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev