org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [UPDATE BATCH_JOB_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE JOB_EXECUTION_ID = ?]; data exception: string data, right truncation; nested exception is java.sql.SQLDataException: data exception: string data, right truncation More stack trace: Caused by: org.hsqldb.HsqlException: data exception: string data, right truncation

Stack Overflow | sachin jain | 5 months ago
  1. 0

    Spring Batch job metadata persistence issue

    Stack Overflow | 5 months ago | sachin jain
    org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [UPDATE BATCH_JOB_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE JOB_EXECUTION_ID = ?]; data exception: string data, right truncation; nested exception is java.sql.SQLDataException: data exception: string data, right truncation More stack trace: Caused by: org.hsqldb.HsqlException: data exception: string data, right truncation
  2. 0

    java-hsqldb-user - data exception: string data, right truncation - while creating index. - msg#00046 - Recent Discussion OSDir.com

    osdir.com | 1 year ago
    org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [CREATE INDEX Table_MXG_NB ON TradeSysFilter (MXG_NB)]; data exception: string data, right truncation in statement [CREATE INDEX TradeSysFilter_MXG_NB ON TradeSysFilter (MXG_NB)]; nested exception is java.sql.SQLDataException: data exception: string data, right truncation in statement [CREATE INDEX TradeSysFilter_MXG_NB ON TradeSysFilter (MXG_NB)]
  3. 0

    Unable to View Pages Due to DataIntegrityViolationException - Atlassian Documentation

    atlassian.com | 2 months ago
    org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.links.OutgoingLink#139527563]; SQL []; Data truncation; nested exception is java.sql.DataTruncation: Data truncation
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    org.hsqldb.HsqlException: data exception: invalid character value for cast

    Stack Overflow | 3 years ago | Kyle
    org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [SELECT * FROM some_table WHERE id=?]; data exception: invalid character value for cast; nested exception is java.sql.SQLDataException: data exception: invalid character value for cast
  6. 0

    h5. Steps to reproduce: # Create a page # Insert the following text in Rich-Text Editor: {noformat} [this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. this is 256 character. thissssss is 256 character:test123] {noformat} # Save the page # User will get a System Error page with the following error: {noformat} org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.links.OutgoingLink#4784133]; SQL []; Data truncation: Data too long for column 'DESTSPACEKEY' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'DESTSPACEKEY' at row 1 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:110) caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'DESTSPACEKEY' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3561) {noformat} h5. Workaround # Add a space after the opening square bracket '[' or before the closing square bracket '[' or, # Replace the colon ':' with: {noformat} : {noformat} or, # Insert the text inside [Noformat Macro|http://confluence.atlassian.com/display/DOC/Noformat+Macro] or [Code Block Macro|http://confluence.atlassian.com/display/DOC/Code+Block+Macro]. h5. Findings I think this happens because Rich-Text Editor will take square brackets '[ ]' as a link. So any characters before the colon ':' within the square brackets '[ ]' will be considered as a Space Key. If there are more than 255 characters for that part - ie. before colon ':' within the square brackets '[ ]', this will cause an error because {{DESTSPACEKEY}} column in {{LINKS}} table can only hold 255 characters value as shown below: {noformat} mysql> desc links; +---------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------------+------+-----+---------+-------+ | LINKID | bigint(20) | NO | PRI | NULL | | | DESTPAGETITLE | varchar(255) | YES | | NULL | | | DESTSPACEKEY | varchar(255) | NO | MUL | NULL | | | CONTENTID | bigint(20) | NO | MUL | NULL | | | CREATOR | varchar(255) | YES | | NULL | | | CREATIONDATE | datetime | YES | | NULL | | | LASTMODIFIER | varchar(255) | YES | | NULL | | | LASTMODDATE | datetime | YES | | NULL | | +---------------+--------------+------+-----+---------+-------+ {noformat} This bug has been tested in MySQL, Postgre and SQL Server. But it seems to be not an issue in HSQL.

    Atlassian JIRA | 6 years ago | Husein Alatas [Atlassian]
    org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.links.OutgoingLink#4784133]; SQL []; Data truncation: Data too long for column 'DESTSPACEKEY' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'DESTSPACEKEY' at row 1

    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. org.springframework.dao.DataIntegrityViolationException

      PreparedStatementCallback; SQL [UPDATE BATCH_JOB_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE JOB_EXECUTION_ID = ?]; data exception: string data, right truncation; nested exception is java.sql.SQLDataException: data exception: string data, right truncation More stack trace: Caused by: org.hsqldb.HsqlException: data exception: string data, right truncation

      at org.hsqldb.error.Error.error()
    2. HyperSQL Database
      Error.error
      1. org.hsqldb.error.Error.error(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3]
      2. org.hsqldb.error.Error.error(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3]
      2 frames
    3. HSQLDB
      Session.execute
      1. org.hsqldb.types.CharacterType.castOrConvertToType(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3]
      2. org.hsqldb.types.CharacterType.convertToType(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3]
      3. org.hsqldb.StatementDML.getUpdatedData(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3]
      4. org.hsqldb.StatementDML.executeUpdateStatement(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3]
      5. org.hsqldb.StatementDML.getResult(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3]
      6. org.hsqldb.StatementDMQL.execute(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3]
      7. org.hsqldb.Session.executeCompiledStatement(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3]
      8. org.hsqldb.Session.execute(Unknown Source)[hsqldb-2.3.3.jar!/:2.3.3]
      8 frames