【发布时间】:2013-03-08 12:53:58
【问题描述】:
最近我遇到了以下异常:
org.springframework.dao.DeadlockLoserDataAccessException: PreparedStatementCallback;
它是在我的代码调用以下方法时出现的:
int[] org.springframework.jdbc.core.JdbcTemplate.batchUpdate(String[] sql) throws DataAccessException
简而言之,我在执行批处理 jdbc 查询时得到了DeadlockLoserDataAccessException。
现在,即使它是一个运行时异常,我还是决定抓住它并重试。
但我不确定批处理中的查询会发生什么。他们都回滚了吗?还是抛出此异常之后的查询没有执行,而在此之前的所有查询都已执行?
【问题讨论】:
标签: mysql jdbc spring-jdbc database-deadlocks