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

Graph-based Sorter Attempting Inserts in Wrong Order

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.2.M2
    • 5.0-M2
    • Core Library
    • None

    Description

      Stack trace below - the graph-based sorter appears to be trying to insert a child before a parent - but this is happening non-deterministically (i.e.: some sessions & some users it happens - others not). I haven't managed to reproduce it myself directly - just pulling logs from errors our users have faced today in production.

      I'm not sure of the extent of the info you might need relating to the affected part of the schema - entities at play - let me know and I will update accordingly and very much happy to help investigate further.

      Stack Trace:
      java.sql.SQLException: Cannot convert class [B to SQL type requested due to com.mysql.cj.exceptions.WrongArgumentException - Conversion from [B to BIGINT is not supported.
      at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
      at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
      at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
      at com.mysql.cj.jdbc.ClientPreparedStatement.setObject(ClientPreparedStatement.java:1684)
      at org.apache.cayenne.access.types.ByteArrayType.setJdbcObject(ByteArrayType.java:157)
      at org.apache.cayenne.access.types.ByteArrayType.setJdbcObject(ByteArrayType.java:40)
      at org.apache.cayenne.access.types.ExtendedTypeDecorator.setJdbcObject(ExtendedTypeDecorator.java:63)
      at org.apache.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.java:566)
      at org.apache.cayenne.dba.mysql.MySQLAdapter.bindParameter(MySQLAdapter.java:205)
      at org.apache.cayenne.dba.AutoAdapter.bindParameter(AutoAdapter.java:222)
      at org.apache.cayenne.access.jdbc.SelectAction.bind(SelectAction.java:62)
      at org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:93)
      at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:97)
      at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:273)
      at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:468)
      at org.apache.cayenne.access.DataDomainQueryAction.lambda$runQueryInTransaction$1(DataDomainQueryAction.java:444)
      at org.apache.cayenne.tx.DefaultTransactionManager$BaseTransactionHandler.performInTransaction(DefaultTransactionManager.java:180)
      at org.apache.cayenne.tx.DefaultTransactionManager$NestedTransactionHandler.handle(DefaultTransactionManager.java:93)
      at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:62)
      at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:40)
      at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:443)
      at org.apache.cayenne.access.DataDomainQueryAction.interceptOIDQuery(DataDomainQueryAction.java:177)
      at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:122)
      at org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:570)
      at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:819)
      at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:562)
      at org.apache.cayenne.access.flush.operation.GraphBasedDbRowOpSorter$DbRowOpSnapshotVisitor.getCachedSnapshot(GraphBasedDbRowOpSorter.java:258)
      at org.apache.cayenne.access.flush.operation.GraphBasedDbRowOpSorter$DbRowOpSnapshotVisitor.visitUpdate(GraphBasedDbRowOpSorter.java:240)
      at org.apache.cayenne.access.flush.operation.GraphBasedDbRowOpSorter$DbRowOpSnapshotVisitor.visitUpdate(GraphBasedDbRowOpSorter.java:216)
      at org.apache.cayenne.access.flush.operation.UpdateDbRowOp.accept(UpdateDbRowOp.java:42)
      at org.apache.cayenne.access.flush.operation.GraphBasedDbRowOpSorter.getParentsOpId(GraphBasedDbRowOpSorter.java:174)
      at org.apache.cayenne.access.flush.operation.GraphBasedDbRowOpSorter.lambda$processRelationships$8(GraphBasedDbRowOpSorter.java:128)
      at java.util.ArrayList.forEach(ArrayList.java:1257)
      at org.apache.cayenne.access.flush.operation.GraphBasedDbRowOpSorter.processRelationships(GraphBasedDbRowOpSorter.java:127)
      at org.apache.cayenne.access.flush.operation.GraphBasedDbRowOpSorter.lambda$sort$5(GraphBasedDbRowOpSorter.java:113)
      at java.util.ArrayList.forEach(ArrayList.java:1257)
      at org.apache.cayenne.access.flush.operation.GraphBasedDbRowOpSorter.sort(GraphBasedDbRowOpSorter.java:112)
      at org.apache.cayenne.access.flush.DefaultDataDomainFlushAction.sort(DefaultDataDomainFlushAction.java:153)
      at org.apache.cayenne.access.flush.DefaultDataDomainFlushAction.flush(DefaultDataDomainFlushAction.java:87)
      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.M2 Oct 06 2020 14:46:02] 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

            Unassigned Unassigned
            hvass Peter Hvass

            Dates

              Created:
              Updated:

              Slack

                Issue deployment