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

ConcurrentModificationException when Inserting

Agile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 4.2.M3
    • 4.2.B1
    • None
    • None

    Description

      We're seeing an odd CoModException when recording visit information on our web app - we assemble information related to the visit (i.e.: page visited, date of visit) and then commit. Vast majority of cases this works except a rare few where we see the following stack trace.

      Always thankful for this project and its maintenance - if there is anything I can do to help debug or provide further info please just let me know.

      Stack Trace:
      java.util.ConcurrentModificationException
      at java.util.HashMap.forEach(HashMap.java:1292)
      at org.apache.cayenne.access.flush.operation.Values.merge(Values.java:90)
      at org.apache.cayenne.access.flush.operation.DbRowOpMerger.mergeValues(DbRowOpMerger.java:75)
      at org.apache.cayenne.access.flush.operation.DbRowOpMerger.visitInsert(DbRowOpMerger.java:49)
      at org.apache.cayenne.access.flush.operation.DbRowOpMerger.visitInsert(DbRowOpMerger.java:29)
      at org.apache.cayenne.access.flush.operation.InsertDbRowOp.accept(InsertDbRowOp.java:40)
      at org.apache.cayenne.access.flush.operation.DbRowOpMerger.apply(DbRowOpMerger.java:41)
      at org.apache.cayenne.access.flush.operation.DbRowOpMerger.apply(DbRowOpMerger.java:29)
      at java.util.HashMap.merge(HashMap.java:1254)
      at org.apache.cayenne.access.flush.DefaultDataDomainFlushAction.lambda$mergeSameObjectIds$2(DefaultDataDomainFlushAction.java:133)
      at java.util.ArrayList.forEach(ArrayList.java:1257)
      at org.apache.cayenne.access.flush.DefaultDataDomainFlushAction.mergeSameObjectIds(DefaultDataDomainFlushAction.java:133)
      at org.apache.cayenne.access.flush.DefaultDataDomainFlushAction.flush(DefaultDataDomainFlushAction.java:85)
      at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:637)
      at org.apache.cayenne.access.DataDomain.onSyncNoFilters(DataDomain.java:609)
      at org.apache.cayenne.access.DataDomain$DataDomainSyncFilterChain.onSync(DataDomain.java:835)
      at org.apache.cayenne.tx.TransactionFilter.lambda$onSync$0(TransactionFilter.java:61)
      at org.apache.cayenne.tx.DefaultTransactionManager$BaseTransactionHandler.performInTransaction(DefaultTransactionManager.java:180)
      at org.apache.cayenne.tx.DefaultTransactionManager$BaseTransactionHandler.performInNewTransaction(DefaultTransactionManager.java:152)
      at org.apache.cayenne.tx.DefaultTransactionManager$NestedTransactionHandler.handle(DefaultTransactionManager.java:95)
      at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:62)
      at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:40)
      at org.apache.cayenne.tx.TransactionFilter.onSync(TransactionFilter.java:61)
      at org.apache.cayenne.access.DataDomain$DataDomainSyncFilterChain.onSync(DataDomain.java:834)
      at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:596)
      at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:737)
      [wrapped] org.apache.cayenne.CayenneRuntimeException: [v.4.2.M3 Mar 13 2021 14:15:14] Commit Exception
      at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:769)
      at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:686)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ntimofeev Nikita Timofeev
            hvass Peter Hvass
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment