We are catching all DataAccessExceptions and reporting the exception using ex.getMessage(). Recently we got the following exception message:
(executing StatementCallback): encountered SQLException [JZ0BE: BatchUpdateException: Error occurred while executing batch statement: Your server command (family id #0, process id #106) encountered a deadlock situation. Please re-run your command.];
nested exception is com.sybase.jdbc2.jdbc.SybBatchUpdateException: JZ0BE: BatchUpdateException: Error occurred while executing batch statement: Your server command (family id #0, process id #106) encountered a deadlock situation. Please re-run your command.
This exception was thrown when executing the following code:
jdbcTemplate.batchUpdate( sql );
Where sql is an array of SQL statements.
The actual Spring exception thrown was org.springframework.jdbc.UncategorizedSQLException and the stack trace was:
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseBatchUpdat eException(ErrorMessage.java:802)
at com.sybase.jdbc2.jdbc.SybStatement.batchLoop(SybSt atement.java:1329)
at com.sybase.jdbc2.jdbc.SybStatement.sendBatch(SybSt atement.java:1138)
at com.sybase.jdbc2.jdbc.SybStatement.executeBatch(Sy bStatement.java:1105)
at com.sybase.jdbc2.jdbc.SybStatement.executeBatch(Sy bStatement.java:949)
at org.springframework.jdbc.core.JdbcTemplate$1BatchU pdateStatementCallback.doInStatement(JdbcTemplate. java:389)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:256)
at org.springframework.jdbc.core.JdbcTemplate.batchUp date(JdbcTemplate.java:408)
I am assuming that the correct Spring exception, if this were mapped correctly, would be DeadlockLoserDataAccessException.
However, the Sybase mapping didn't pick it up. What is the procedure for getting an update to the mapping code to pick this up?
Thanks,
SZ


Reply With Quote