现在位置:首页 » » berkeleydb:LockTimeoutException: (JE 5.0.73) Lock expired异常处理
berkeleydb:LockTimeoutException: (JE 5.0.73) Lock expired异常处理
网页爬虫爬取数据时出现com.sleepycat.je.LockTimeoutException: (JE 5.0.73) Lock expired
程序异常如下:
com.sleepycat.je.LockTimeoutException: (JE 5.0.73) Lock expired. Locker 20922098
14 -1_Thread-19_ThreadLocker: waited for lock on database=countDb LockAddr:1726642001 LSN=0x0/0x1046c type=READ grant=WAIT_NEW timeoutMillis=500 startTime=14927
38773627 endTime=1492738774127
Owners: [<LockInfo locker="219132225 -1_Thread-12_ThreadLocker" type="READ"/>, <
LockInfo locker="1918327159 -1_Thread-11_ThreadLocker" type="READ"/>, <LockInfo
locker="1452383279 -1_Thread-13_ThreadLocker" type="READ"/>, <LockInfo locker="2
078649396 -1_Thread-15_ThreadLocker" type="READ"/>, <LockInfo locker="898932509
-1_Thread-14_ThreadLocker" type="READ"/>]
出现这个问题的原因可能是多线程同时对数据库进行读取造成的,在读取的方法中加入同步synchronized可以解决
本文固定链接:http://www.yizhi227.com/?post=84
本文由Jessie原创或编辑,互联分享,尊重版权,转载请以链接形式标明本文地址
本文由Jessie原创或编辑,互联分享,尊重版权,转载请以链接形式标明本文地址