[JIRA] Created: (CAY-870) Race condition in ClassDescriptorMap

From: Andrus Adamchik (JIRA) ("Andrus)
Date: Wed Oct 03 2007 - 06:00:56 EDT

  • Next message: Aristedes Maniatis: "pages for deletion"

    Race condition in ClassDescriptorMap
    ------------------------------------

                     Key: CAY-870
                     URL: https://issues.apache.org/cayenne/browse/CAY-870
                 Project: Cayenne
              Issue Type: Bug
              Components: Cayenne Core Library
        Affects Versions: 3.0
             Environment: Cayenne 3.0 (trunk build sometime after M1)
                Reporter: Andrus Adamchik
                Assignee: Andrus Adamchik
                 Fix For: 3.0

    Not sure if 1.2/2.0 is affected...

    I am seeing my app getting stuck on startup occasionally. Thread dump shows a few threads stuck in trying to get a class descriptor (see below). This is similar to CAY-845, only happens in a different place. Looks like ClassDescriptorMap lazy initialization can cause such race condition.

    at java.util.HashMap.get(HashMap.java:346)
            at org.apache.cayenne.reflect.ClassDescriptorMap.getDescriptor(ClassDescriptorMap.java:92)
            at org.apache.cayenne.reflect.generic.DataObjectDescriptorFactory.createToManyProperty(DataObjectDescriptorFactory.java:68)
            at org.apache.cayenne.reflect.PersistentDescriptorFactory.getDescriptor(PersistentDescriptorFactory.java:96)
            at org.apache.cayenne.reflect.generic.DataObjectDescriptorFactory.getDescriptor(DataObjectDescriptorFactory.java:51)
            at org.apache.cayenne.reflect.PersistentDescriptorFactory.getDescriptor(PersistentDescriptorFactory.java:51)
            at org.apache.cayenne.reflect.ClassDescriptorMap.createDescriptor(ClassDescriptorMap.java:122)
            at org.apache.cayenne.reflect.LazyClassDescriptorDecorator.checkDescriptorInitialized(LazyClassDescriptorDecorator.java:49)
            at org.apache.cayenne.reflect.LazyClassDescriptorDecorator.getEntity(LazyClassDescriptorDecorator.java:73)
            at org.apache.cayenne.access.trans.SelectTranslator.appendQueryColumns(SelectTranslator.java:357)
            at org.apache.cayenne.access.trans.SelectTranslator.buildResultColumns(SelectTranslator.java:332)
            at org.apache.cayenne.access.trans.SelectTranslator.createSqlString(SelectTranslator.java:107)
            at org.apache.cayenne.dba.mysql.MySQLSelectTranslator.createSqlString(MySQLSelectTranslator.java:31)
            at org.apache.cayenne.access.trans.QueryAssembler.createStatement(QueryAssembler.java:95)
            at org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:71)
            at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:57)

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Wed Oct 03 2007 - 06:01:23 EDT