java.sql.SQLIntegrityConstraintViolationException: DELETE on table 'QRTZ_TRIGGERS' caused a violation of foreign key constraint 'SQL110119171738411' for key (Schedule.0,TRIGGER_GROUP_SIMPLE). The statement has been rolled back.]

Terracotta | schrock | 6 years ago
  1. 0

    Foreign key exception when deleting trigger?

    Terracotta | 6 years ago | schrock
    java.sql.SQLIntegrityConstraintViolationException: DELETE on table 'QRTZ_TRIGGERS' caused a violation of foreign key constraint 'SQL110119171738411' for key (Schedule.0,TRIGGER_GROUP_SIMPLE). The statement has been rolled back.]
  2. 0

    In italy we have names with single quote in patient names like " ' ": d'onofrio, d'avellano,d'allonzo ..... The error I receive is: Aug 11, 2010 10:50:06 AM in.raster.mayam.util.database.DatabaseHandler insertPatientData SEVERE: null java.sql.SQLSyntaxErrorException: Syntax error: Encountered "onofrio" at line 1, column 59. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) .......... at java.lang.Thread.run(Thread.java:619) Caused by: java.sql.SQLException: Syntax error: Encountered "onofrio" at line 1, column 59. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 24 more Aug 11, 2010 10:50:06 AM in.raster.mayam.util.database.DatabaseHandler insertStudyData SEVERE: null java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'STUDY' caused a violation of foreign key constraint 'SQL100616050025040' for key (CTPETPI1_CTPET-0074684728). 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) we need a method to escape the characters in a String to be suitable to pass to an SQL query. If I do (from jdbc docs) : static public String escapeLine(String s) { String retvalue = s; if (s.indexOf ("'") != -1 ) { StringBuffer hold = new StringBuffer(); char c; for(int i=0; i < s.length(); i++ ) { if ((c=s.charAt(i)) == '\'' ) { hold.append ("''"); }else { hold.append(c); } } retvalue = hold.toString(); } return retvalue; } conn.createStatement().execute("insert into " + patientTable + " values('" + escapeLine(dataset.getString(Tag.PatientID)) + "','" +escapeLine( dataset.getString(Tag.PatientName)) + "'," + dat + ",'" + dataset.getString(Tag.PatientSex) + "')"); it works !! Do you know some other method in order to do so ?? (PreparedStatement ??) Or I can Commit this? Paolo

    JIRA | 6 years ago | Paolo Marcheschi
    java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'STUDY' caused a violation of foreign key constraint 'SQL100616050025040' for key (CTPETPI1_CTPET-0074684728). The statement has been rolled back.
  3. 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.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.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Chapter 8 - Getting an error while running ant script using glassfish

    manning.com | 11 months ago
    java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'USERS' caused a violation of foreign key constraint 'FK _USERS_USER_ID' for key (idiot2). The statement has been rolled back. Error Code: -1
  6. 0

    JPA OneToMany With Identity Generated Parent ID persist Error

    Stack Overflow | 2 years ago | Omar Abdullwahhab
    java.sql.SQLIntegrityConstraintViolationException: INSERT on table 'INV_LINES' caused a violation of foreign key constraint 'INV_LINES_INV_ID' for key (0). The statement has been rolled back. Error Code: 20000 Call: INSERT INTO INV_LINES (INV_ID, NOTES, QTY, STOCK_ITEM, TOTAL_PRICE, WARRANTY, DAYS_WARRANTY) VALUES (?, ?, ?, ?, ?, ?, ?) bind =&gt; [7 parameters bound] Query: InsertObjectQuery(com.mehwar.model.InvoiceLine@28444350)

    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.SQLIntegrityConstraintViolationException

      DELETE on table 'QRTZ_TRIGGERS' caused a violation of foreign key constraint 'SQL110119171738411' for key (Schedule.0,TRIGGER_GROUP_SIMPLE). The statement has been rolled back.]

      at org.quartz.impl.jdbcjobstore.JobStoreSupport.replaceTrigger()
    2. quartz
      StdScheduler.rescheduleJob
      1. org.quartz.impl.jdbcjobstore.JobStoreSupport.replaceTrigger(JobStoreSupport.java:1517)
      2. org.quartz.impl.jdbcjobstore.JobStoreSupport$9.execute(JobStoreSupport.java:1484)
      3. org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:242)
      4. org.quartz.impl.jdbcjobstore.JobStoreSupport.replaceTrigger(JobStoreSupport.java:1480)
      5. org.quartz.core.QuartzScheduler.rescheduleJob(QuartzScheduler.java:991)
      6. org.quartz.impl.StdScheduler.rescheduleJob(StdScheduler.java:302)
      6 frames