Java db2 error SQLCODE=-913 SQLSTATE=57003 SQLERRMC=schema.table; table, driver=4.1xxx

烈酒焚心 提交于 2019-12-11 10:41:55

问题


I wrote a simple Java application that basically execute an SELECT SQL statement comprising of 4 joined tables. I then execute the SQL statement and save it to a resultSet. When I am looping through the resultSet, on the 200K+ record out of 300K+, I am getting this error message:

SQLCODE=-913 SQLSTATE=57003 SQLERRMC=schema.table; table, driver=4.1xxx

Based on what I have read so far, this means its a deadlock error. Is it possible for this to occur on such a small resultset (300K), and on a select statement?


回答1:


A deadlock occurs when two or more transactions are in a cycle of lock wait for one another, and a lock timeout does not break the cycle. By default, when row locking is performed during a table or index scan, DB2 locks each row before determining whether the row qualifies for the query. Chances are that your table or index scan is taking too long and there are other pending transactions.

Here is a wonderful document about locks for DB2. http://www.ibm.com/developerworks/data/library/techarticle/dm-0509schuetz/ there is also some suggestions on how to solve locking issues.



来源:https://stackoverflow.com/questions/31063300/java-db2-error-sqlcode-913-sqlstate-57003-sqlerrmc-schema-table-table-driver

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!