JDBC+MYSQL 事务处理问题 急!
数据库书MYSQL
代码如下:
String strSQL[] = new String[2];
strSQL[0] = "update sys_role set Sys_Role_Summary = '2222' where Sys_Role_Code = '1'"; //对的
strSQL[1] = "update sys_role set Sys_Role_Summary = '2222' where Sys_Role_Cod = '2'"; //错的
try
{
getConn();
conn.setAutoCommit(false);
for(int i=0;i<strSQL.length;i++)
stmt.executeUpdate(strSQL[i]);
conn.commit();
}catch(Exception e)
{
conn.rollback();
throw new SQLException("错误原因:" + e.getMessage());
}finally
{
freeConn();
}
最后捕捉的错误是:General error: Warning: Some non-transactional changed tables couldn't be rolled back
当然也没回滚成功,怎么回事啊?