Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-870

Race condition in ClassDescriptorMap

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0M2
    • Core Library
    • None
    • Cayenne 3.0 (trunk build sometime after M1)

    Description

      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)

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: