Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Full Identity Map that has relationships to objects cached in weaker types

JPA may change the picture (I think not), but 1-1 relations are either a direct reference or some subtype of ValueHolder and 1-N are typically just the given collection type. So in all cases, unless the ValueHolder or collection themselves use weak references internally, you effectively have a hard reference in place between the (hard cached) object and the object it references, which would prevent GC of the latter. And I'm not aware that EclipseLink has any ValueHolder or collections of that sort.
That said, whether this is actually a problem or not would depend on the size of the FullIdentityMap cache (most objects may be cycled out of that cache anyway), cardinality of the relation, etc. Typically though you'd only use full identify maps for things like referentials (e.g. say products) and the more transactional data (e.g. say, orders) wold be in the weaker maps, and the references would be from transactional data to referentials, not vice-versa (e.g. orders lines point to products but not vice-versa).


On Sat, Dec 27, 2008 at 5:10 PM, zebhed <zebhed@xxxxxxx> wrote:

I have found an article by Yorke/Melanson on the web that is related to

There is a statement about entities held in Full Identity Maps:
"It is important to make sure that types like this do not have relationships
to objects cached in weaker types. Object types stored in a FullIdentityMap
cache holding references to types in a weak cache effectively make the weak
cached objects held indefinitely."

I do not know how old this article is. I wonder if this statement is still
true (for EclipseLink). If it is, I think I will have to alter my caching
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

eclipselink-users mailing list

Back to the top