You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Oleg Artyukevich (JIRA)" <ji...@apache.org> on 2013/12/24 14:32:50 UTC

[jira] [Updated] (CAY-1868) Select contention with multiple contexts

     [ https://issues.apache.org/jira/browse/CAY-1868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Artyukevich updated CAY-1868:
----------------------------------

    Attachment: cay1868.patch

Make additional check, before run synchronized body of ObjRelationship.refreshFromDeferredPath() method. 
ObjRelationship.deferredPath used on loading. After relationships initialized, this field becomes null and there is no need to block monitor of object and try to load relationships from deferredPath. 
Also move recalculating of boolean values of ObjRelationship object in Modeler.

> Select contention with multiple contexts 
> -----------------------------------------
>
>                 Key: CAY-1868
>                 URL: https://issues.apache.org/jira/browse/CAY-1868
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 3.1B2, 3.2M1
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>             Fix For: 3.1B3, 3.2.M2
>
>         Attachments: cay1868.patch
>
>
> I am mostly using local cache and a single app-scoped ObjectContext for selects. So I was oblivious to this issue. Today I tried shared cache and a pool of app-scoped ObjectContexts randomly assigned to requests. I quickly hit a contention point:
>  
>    java.lang.Thread.State: BLOCKED (on object monitor)
>         at org.apache.cayenne.map.ObjRelationship.refreshFromDeferredPath(ObjRelationship.java:572)
>         - waiting to lock <0x424bf840> (a org.apache.cayenne.map.ObjRelationship)
>         at org.apache.cayenne.map.ObjRelationship.isToMany(ObjRelationship.java:431)
>         at org.apache.cayenne.map.ObjRelationship.isOptional(ObjRelationship.java:310)
>         at org.apache.cayenne.map.ObjRelationship.isSourceDefiningTargetPrecenseAndType(ObjRelationship.java:346)
>         at org.apache.cayenne.access.DataDomainQueryAction.interceptRelationshipQuery(DataDomainQueryAction.java:239)
> ObjRelationship recalculating its 'toMany' value on every call is evil by itself. Doing parts of it in a synchronized block is completely unacceptable. 
>  



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)