java.sql.SQLException: DELETE on table 'PROJECTDEPENDENCY' caused a violation of foreign key constraint 'PROJECT_FK3' for key (4858). The statement has been rolled back.

Apache's JIRA Issue Tracker | Michael Johns | 8 years ago
  1. 0

    When trying to delete a project group: javax.jdo.JDOUserException: One or more instances could not be deleted NestedThrowables: javax.jdo.JDODataStoreException: Delete request failed: DELETE FROM PROJECTDEPENDENCY WHERE PROJECTDEPENDENCY_ID=? NestedThrowables: SQL Exception: DELETE on table 'PROJECTDEPENDENCY' caused a violation of foreign key constraint 'PROJECT_FK2' for key (5107). The statement has been rolled back. A snippet of the stack trace: javax.jdo.JDOUserException: One or more instances could not be deleted at org.jpox.AbstractPersistenceManager.deletePersistentAll(AbstractPersistenceManager.java:1525) at org.jpox.AbstractPersistenceManager.deletePersistentAll(AbstractPersistenceManager.java:1498) at org.jpox.store.rdbms.scostore.FKListStore.clear(FKListStore.java:1137) at org.jpox.store.mapping.CollectionMapping.deleteDependent(CollectionMapping.java:334) at org.jpox.store.rdbms.table.ClassTable.deleteDependent(ClassTable.java:2651) at org.jpox.store.StoreManager.deleteDependent(StoreManager.java:1019) at org.jpox.state.StateManagerImpl.deletePersistent(StateManagerImpl.java:4405) at org.jpox.AbstractPersistenceManager.internalDeletePersistent(AbstractPersistenceManager.java:1473) at org.jpox.AbstractPersistenceManager.deletePersistent(AbstractPersistenceManager.java:1489) at org.codehaus.plexus.jdo.PlexusJdoUtils.removeObject(PlexusJdoUtils.java:121) at org.apache.maven.continuum.store.JdoContinuumStore.removeObject(JdoContinuumStore.java:1906) at org.apache.maven.continuum.store.JdoContinuumStore.removeBuildResult(JdoContinuumStore.java:600) at org.apache.maven.continuum.DefaultContinuum.removeProject(DefaultContinuum.java:719) at org.apache.maven.continuum.DefaultContinuum.removeProjectGroup(DefaultContinuum.java:278) at org.apache.maven.continuum.web.action.ProjectGroupAction.remove(ProjectGroupAction.java:263) [...]

    Apache's JIRA Issue Tracker | 8 years ago | Michael Johns
    java.sql.SQLException: DELETE on table 'PROJECTDEPENDENCY' caused a violation of foreign key constraint 'PROJECT_FK3' for key (4858). The statement has been rolled back.
  2. 0

    exception syncing with sync_on_incoming_batch

    symmetricds | 8 years ago | psi_teck
    java.lang.RuntimeException: Unable to update SALE_RETURN_LINE_ITEM: {insert,36,9,9.99,1,1,45}
  3. 0

    JPA: constraints violation on delete

    Stack Overflow | 6 years ago | Jahid
    java.sql.SQLException: DELETE on table 'APPLICATIONENTITY' caused a violation of foreign key constraint 'FK109DF15D362F642' for key (32779). The statement has been rolled back.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Here's my setup: As my destination, I set up HL7 Inspector to listen on port 6660. In Mirth Connect, create a channel with a Channel Reader as the source, TCP Sender (MLLP transmission mode) sending to 6660 as the destination. For Queue Settings, set to Attempt First. Leave everything else as defaults. With HL7 Inspector listening, send a message to the channel. Sends through fine. Now, stop HL7 Inspector. Send another message to the channel. Since HL7 Inspector is no longer listening, the message is queued. Everything good so far. Now go into the message view for the channel and delete the message. The message data is gone. Start the HL7 Inspector listening again. Even though the message has been deleted, on each retry interval, you get the following exception in the server log: 2013-08-24 09:52:16,708] ERROR (com.mirth.connect.connectors.tcp.TcpDispatcher:498): Error processing queued message 2-1 (SENT) for channel 13e934ea-410b-44d7-acc4-a800cc83cf22 (Destination 1). This error is expected if the message was manually removed from the queue. com.mirth.connect.donkey.server.data.DonkeyDaoException: java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.storeContent(JdbcDao.java:289) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.storeMessageContent(JdbcDao.java:222) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.executeTasks(BufferedDao.java:103) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:74) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:61) at com.mirth.connect.donkey.server.channel.DestinationConnector.run(DestinationConnector.java:486) at java.lang.Thread.run(Thread.java:680)Caused by: java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.storeContent(JdbcDao.java:285) ... 6 moreCaused by: java.sql.SQLException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 17 moreCaused by: ERROR 23503: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.execute.ForeignKeyRIChecker.doCheck(Unknown Source) at org.apache.derby.impl.sql.execute.GenericRIChecker.doCheck(Unknown Source) at org.apache.derby.impl.sql.execute.RISetChecker.doFKCheck(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) ... 11 more Additionally, HL7 Inspector will now receive the message over and over again (whatever the retry interval is). And since the message data is deleted, the only recourse is to stop/undeploy the channel.

    Mirth Project | 3 years ago | Eric Butterfield
    java.sql.SQLException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back.
  6. 0

    Here's my setup: As my destination, I set up HL7 Inspector to listen on port 6660. In Mirth Connect, create a channel with a Channel Reader as the source, TCP Sender (MLLP transmission mode) sending to 6660 as the destination. For Queue Settings, set to Attempt First. Leave everything else as defaults. With HL7 Inspector listening, send a message to the channel. Sends through fine. Now, stop HL7 Inspector. Send another message to the channel. Since HL7 Inspector is no longer listening, the message is queued. Everything good so far. Now go into the message view for the channel and delete the message. The message data is gone. Start the HL7 Inspector listening again. Even though the message has been deleted, on each retry interval, you get the following exception in the server log: 2013-08-24 09:52:16,708] ERROR (com.mirth.connect.connectors.tcp.TcpDispatcher:498): Error processing queued message 2-1 (SENT) for channel 13e934ea-410b-44d7-acc4-a800cc83cf22 (Destination 1). This error is expected if the message was manually removed from the queue. com.mirth.connect.donkey.server.data.DonkeyDaoException: java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.storeContent(JdbcDao.java:289) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.storeMessageContent(JdbcDao.java:222) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.executeTasks(BufferedDao.java:103) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:74) at com.mirth.connect.donkey.server.data.buffered.BufferedDao.commit(BufferedDao.java:61) at com.mirth.connect.donkey.server.channel.DestinationConnector.run(DestinationConnector.java:486) at java.lang.Thread.run(Thread.java:680)Caused by: java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source) at com.mirth.connect.donkey.server.data.jdbc.JdbcDao.storeContent(JdbcDao.java:285) ... 6 moreCaused by: java.sql.SQLException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 17 moreCaused by: ERROR 23503: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.execute.ForeignKeyRIChecker.doCheck(Unknown Source) at org.apache.derby.impl.sql.execute.GenericRIChecker.doCheck(Unknown Source) at org.apache.derby.impl.sql.execute.RISetChecker.doFKCheck(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) ... 11 more Additionally, HL7 Inspector will now receive the message over and over again (whatever the retry interval is). And since the message data is deleted, the only recourse is to stop/undeploy the channel.

    Mirth Project | 3 years ago | Eric Butterfield
    com.mirth.connect.donkey.server.data.DonkeyDaoException: java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'D_MC2' caused a violation of foreign key constraint 'MC2_FKEY' for key (2,1). The statement has been rolled back.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLException

      DELETE on table 'PROJECTDEPENDENCY' caused a violation of foreign key constraint 'PROJECT_FK3' for key (4858). The statement has been rolled back.

      at org.apache.derby.client.am.SQLExceptionFactory.getSQLException()
    2. Apache Derby Client JDBC Driver
      PreparedStatement.executeUpdate
      1. org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
      2. org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
      3. org.apache.derby.client.am.PreparedStatement.executeUpdate(Unknown Source)
      3 frames
    3. org.apache.tomcat
      DelegatingPreparedStatement.executeUpdate
      1. org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
      1 frame
    4. org.jpox.store
      StoreManager.delete
      1. org.jpox.store.rdbms.RDBMSManager.executeStatementUpdate(RDBMSManager.java:575)
      2. org.jpox.store.rdbms.request.DeleteRequest.execute(DeleteRequest.java:274)
      3. org.jpox.store.rdbms.table.ClassTable.delete(ClassTable.java:2611)
      4. org.jpox.store.StoreManager.delete(StoreManager.java:1025)
      4 frames
    5. org.jpox.state
      StateManagerImpl.deletePersistent
      1. org.jpox.state.StateManagerImpl.internalDeletePersistent(StateManagerImpl.java:4468)
      2. org.jpox.state.StateManagerImpl.deletePersistent(StateManagerImpl.java:4423)
      2 frames
    6. org.jpox
      AbstractPersistenceManager.deletePersistentAll
      1. org.jpox.AbstractPersistenceManager.internalDeletePersistent(AbstractPersistenceManager.java:1489)
      2. org.jpox.AbstractPersistenceManager.deletePersistentAll(AbstractPersistenceManager.java:1532)
      3. org.jpox.AbstractPersistenceManager.deletePersistentAll(AbstractPersistenceManager.java:1514)
      3 frames
    7. org.jpox.store
      StoreManager.deleteDependent
      1. org.jpox.store.rdbms.scostore.FKListStore.clear(FKListStore.java:1137)
      2. org.jpox.store.mapping.CollectionMapping.deleteDependent(CollectionMapping.java:334)
      3. org.jpox.store.rdbms.table.ClassTable.deleteDependent(ClassTable.java:2651)
      4. org.jpox.store.StoreManager.deleteDependent(StoreManager.java:1076)
      4 frames
    8. org.jpox.state
      StateManagerImpl.deletePersistent
      1. org.jpox.state.StateManagerImpl.deletePersistent(StateManagerImpl.java:4405)
      1 frame
    9. org.jpox
      AbstractPersistenceManager.deletePersistent
      1. org.jpox.AbstractPersistenceManager.internalDeletePersistent(AbstractPersistenceManager.java:1489)
      2. org.jpox.AbstractPersistenceManager.deletePersistent(AbstractPersistenceManager.java:1505)
      2 frames
    10. org.codehaus.plexus
      PlexusJdoUtils.removeObject
      1. org.codehaus.plexus.jdo.PlexusJdoUtils.removeObject(PlexusJdoUtils.java:121)
      1 frame
    11. org.apache.continuum
      BuildResultDaoImpl.removeBuildResult
      1. org.apache.continuum.dao.AbstractDao.removeObject(AbstractDao.java:77)
      2. org.apache.continuum.dao.BuildResultDaoImpl.removeBuildResult(BuildResultDaoImpl.java:259)
      2 frames
    12. org.apache.maven
      ProjectsListAction.execute
      1. org.apache.maven.continuum.DefaultContinuum.removeBuildResult(DefaultContinuum.java:1380)
      2. org.apache.maven.continuum.DefaultContinuum.removeProject(DefaultContinuum.java:899)
      3. org.apache.maven.continuum.web.action.ProjectsListAction.remove(ProjectsListAction.java:100)
      4. org.apache.maven.continuum.web.action.ProjectsListAction.execute(ProjectsListAction.java:68)
      4 frames