Results 1 to 2 of 2

Thread: DataAccessException for a deadlock not mapped

  1. #1
    Join Date
    Jan 2005
    Posts
    15

    Default DataAccessException for a deadlock not mapped

    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

  2. #2
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    Modify a copy of sql-error-codes.xml and put in your classpath before the rest of Spring. You would need to add entry in the Sybase object to include support for the exception you are looking for. Basically you would set the DeadlockLoserCodes property with the proper SQLErrorCode values. For a complete list of property names for the objects in sql-error-codes.xml see SQLErrorCodes

    If you feel this should belong in the release version of sql-error-codes.xml (and perhaps other SQLErrorCode mappings) you could enter an issue in JIRA.

Similar Threads

  1. table is not mapped exception
    By Johannes Hiemer in forum Data
    Replies: 5
    Last Post: Nov 22nd, 2007, 11:33 AM
  2. Replies: 4
    Last Post: Aug 17th, 2005, 04:42 AM
  3. catching DataAccessException
    By Cuball in forum Data
    Replies: 3
    Last Post: May 20th, 2005, 07:40 AM
  4. Replies: 2
    Last Post: May 13th, 2005, 05:42 AM
  5. SchedulerFactoryBean deadlock
    By dhalbrook in forum Container
    Replies: 0
    Last Post: Jan 6th, 2005, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •