openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Wisneski" <wisnes...@gmail.com>
Subject datacache behavior fetchPlan, insertable, updateable
Date Mon, 28 Apr 2008 18:07:00 GMT
Behavior of retrieving an entity is different when retrieving from the
DataCache vs. Database.   An example scenario:
     persist new entity with field1=1, field2=2, field3=3
field 2 and field 3 are mapped to column 2 and field3 is marked as
insertable=false, updateable=false.

If the entity is fetched from the database, the values of field1,2,3
are (1,2,2).  However if the data comes from the DataCache the values
are (1,2,3).

The DataCache is not honoring the settings of insertable, updateable
when copying data from the Entity to the CacheEntry.

Is this behavior working as designed or a bug?

A similar remark applies to FetchPlan and DataCache.  If an entity
field is marked EAGER,  and the data is fetched from DataCache, if an
EAGER field has not data, then no database fetch is triggered.

So a retrieve from DataCache seems to be giving whatever data is in
the CacheEntry and is not honoring eager fields.

Is this working as designed or a bug?

The OpenJPA manual does not document how insertable, updateable, eager
work regarding DataCache.    From a practical point of view,
DataCache should not change the semantics of EntityManager operations.
 So these behaviors might be classified as bugs.

Do others agree ?

Mime
View raw message