Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to retrieve SQL batch on failure when using BatchSqlUpdate [SPR-10470] #15103

Closed
spring-projects-issues opened this issue Apr 17, 2013 · 1 comment
Labels
in: data status: bulk-closed

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Apr 17, 2013

Giovanni Botta opened SPR-10470 and commented

When a batch insert/update fails in BatchSqlUpdate, an exception such as the following is thrown:

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)

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


Affects: 3.2.1

@spring-projects-issues spring-projects-issues added status: waiting-for-triage in: data type: enhancement and removed type: enhancement labels Jan 11, 2019
@rstoyanchev rstoyanchev added status: bulk-closed and removed status: waiting-for-triage labels Jan 11, 2019
@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 12, 2019

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data status: bulk-closed
Projects
None yet
Development

No branches or pull requests

2 participants