org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO pvaprice_upsert (QuoteId,Ric,Currency,Exchange,TradeDate,PriceClose,PriceHigh,PriceOpen,PriceLow,Vol,creationdate,lastmodifieddate) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]; SQL state [5000A]; error code [135186]; An attempt to place a null value in a non-nullable datatype.; nested exception is java.sql.BatchUpdateException: An attempt to place a null value in a non-nullable datatype.

Spring JIRA | Giovanni Botta | 4 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    When a batch insert/update fails in BatchSqlUpdate, an exception such as the following is thrown: {code} org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO pvaprice_upsert (QuoteId,Ric,Currency,Exchange,TradeDate,PriceClose,PriceHigh,PriceOpen,PriceLow,Vol,creationdate,lastmodifieddate) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]; SQL state [5000A]; error code [135186]; An attempt to place a null value in a non-nullable datatype.; nested exception is java.sql.BatchUpdateException: An attempt to place a null value in a non-nullable datatype. at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:884) at org.springframework.jdbc.object.BatchSqlUpdate.flush(BatchSqlUpdate.java:184) {code} It would be very useful to be able to retrieve the batch that failed in order to look at the data to diagnose why the failure happened. This shouldn't be too difficult (I might give it a try over the weekend). Thanks

    Spring JIRA | 4 years ago | Giovanni Botta
    org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO pvaprice_upsert (QuoteId,Ric,Currency,Exchange,TradeDate,PriceClose,PriceHigh,PriceOpen,PriceLow,Vol,creationdate,lastmodifieddate) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]; SQL state [5000A]; error code [135186]; An attempt to place a null value in a non-nullable datatype.; nested exception is java.sql.BatchUpdateException: An attempt to place a null value in a non-nullable datatype.
  2. 0

    When a batch insert/update fails in BatchSqlUpdate, an exception such as the following is thrown: {code} org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO pvaprice_upsert (QuoteId,Ric,Currency,Exchange,TradeDate,PriceClose,PriceHigh,PriceOpen,PriceLow,Vol,creationdate,lastmodifieddate) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]; SQL state [5000A]; error code [135186]; An attempt to place a null value in a non-nullable datatype.; nested exception is java.sql.BatchUpdateException: An attempt to place a null value in a non-nullable datatype. at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:884) at org.springframework.jdbc.object.BatchSqlUpdate.flush(BatchSqlUpdate.java:184) {code} It would be very useful to be able to retrieve the batch that failed in order to look at the data to diagnose why the failure happened. This shouldn't be too difficult (I might give it a try over the weekend). Thanks

    Spring JIRA | 4 years ago | Giovanni Botta
    org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO pvaprice_upsert (QuoteId,Ric,Currency,Exchange,TradeDate,PriceClose,PriceHigh,PriceOpen,PriceLow,Vol,creationdate,lastmodifieddate) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]; SQL state [5000A]; error code [135186]; An attempt to place a null value in a non-nullable datatype.; nested exception is java.sql.BatchUpdateException: An attempt to place a null value in a non-nullable datatype.

    Root Cause Analysis

    1. org.springframework.jdbc.UncategorizedSQLException

      PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO pvaprice_upsert (QuoteId,Ric,Currency,Exchange,TradeDate,PriceClose,PriceHigh,PriceOpen,PriceLow,Vol,creationdate,lastmodifieddate) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]; SQL state [5000A]; error code [135186]; An attempt to place a null value in a non-nullable datatype.; nested exception is java.sql.BatchUpdateException: An attempt to place a null value in a non-nullable datatype.

      at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate()
    2. Spring Framework
      BatchSqlUpdate.flush
      1. org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
      2. org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
      3. org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
      4. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)
      5. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615)
      6. org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:884)
      7. org.springframework.jdbc.object.BatchSqlUpdate.flush(BatchSqlUpdate.java:184)
      7 frames