cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Lewis (JIRA)" <>
Subject [jira] [Commented] (CAY-596) DataObject cache works incorrect !
Date Thu, 03 May 2012 16:48:49 GMT


Bryan Lewis commented on CAY-596:

I've had issues like this, although I never could pin it down reliably.  I tried making a
test case twice, but the problem never happened in the test cases.

The most frequent failure for me was in a Tapestry CRUD page editing a main item, where an
object got added or deleted from a to-many relationship ina  secondary detail-editor page.
 When the main page re-rendered the item didn't show the change.  I worked around it on a
page-by-page basis, invalidating the item after such an add/delete operation.  It happened
on more and more pages, the most recent case being a change in a simple attribute not appearing.

Finally I realized that few of my pages were trusting the object cache, so I switched my Tapestry
encoder from DataObjectUtils.objectForPK() to a refetch with an ObjectIdQuery(id, CACHE_REFRESH).
 It takes only a few milliseconds to refetch an item.
> DataObject cache works incorrect !
> ----------------------------------
>                 Key: CAY-596
>                 URL:
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 1.2 branch
>         Environment: Windows XP,  1.4.2_06 by Sun Microsystems Inc., DB Oracle 
>            Reporter: Paul Ponec
>            Priority: Critical
> Data object util method: 
>         DataObjectUtils.objectForPK(context, persistentClass, (Object) id);
> returns sometimes (freqency 30% on my sample) a DataObject with an old property value.
> If I am using code:
>         Expression expr = ExpressionFactory.matchExp("id", id);
>         SelectQuery query = new SelectQuery(persistentType, expr);
>         List list = context.performQuery(query);
>         return list.size()==1 ? list.get(0) : null;
> then result (all object properties) is OK always.
> ---
> A selection from map.xml:
> <db-entity name="CALL" schema="TEST">
> 		<db-attribute name="id" type="NUMERIC" isPrimaryKey="true" isMandatory="true"/>
> 		<db-attribute name="sign" type="VARCHAR" length="1"/>
> </db-entity>
> <obj-entity name="Call" className="xxx.Call" dbEntityName="CALL">
> 		<obj-attribute name="id" type="java.math.BigDecimal" db-attribute-path="id"/>
> 		<obj-attribute name="sign" type="java.lang.String" db-attribute-path="sign"/>
> </obj-entity>

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message