mongo抛出异常:com.mongodb.MongoException: Lock not granted. Try restarting the transaction 解决方式
2017-11-06 11:09
573 查看
原因是使用findandmodify中的query 条件对应的字段没有建索引,导致mongo查询缓慢,形成工作队列,在mongo中建好索引后问题得到解决。
db.demo.createIndex({"id": 1}, {name: "index_id"});
参考链接:点击打开链接
I have some problem.
I am actually getting this error because of a lot updates without the right index.
It looks like each update requires too much time, so the queue of operations increases, and a lock related timeout is fired, and the operations on the queue are dropped out.After having setted the index up, the error does not appear anymore.
db.demo.createIndex({"id": 1}, {name: "index_id"});
参考链接:点击打开链接
I have some problem.
I am actually getting this error because of a lot updates without the right index.
It looks like each update requires too much time, so the queue of operations increases, and a lock related timeout is fired, and the operations on the queue are dropped out.After having setted the index up, the error does not appear anymore.
相关文章推荐
- 解决com.mongodb.MongoException$CursorNotFound: cursor 0 not found on server
- 使用zxing识别二维码时抛出com.google.zxing.NotFoundException异常问题的解决
- com.mongodb.MongoException$CursorNotFound: cursor not found on server异常处理
- hibernate操作mysql时抛出Lock wait timeout exceeded; try restarting transaction异常
- 解决com.mongodb.MongoException$CursorNotFound: cursor 0 not found on server
- iOS "The sandbox is not in sync with the Podfile.lock"解决方式
- mysql报错:Deadlock found when trying to get lock; try restarting transaction的解决方法
- mysql执行update提示ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction的应急解决方法
- the given port name does not start with COM/com异常解决办法
- 异常:System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms 这个实现是不是Windows平台FIPS验证的加密算法。解决方法
- javah导出类的头文件抛出异常——java.lang.IllegalArgumentException: Not a valid class name(原因及解决方法)
- com.mongodb.MongoException$CursorNotFound: cursor not found on server异常处理
- wp7使用POST请求Asp.net网页时,HttpWebRequest的BeginGetResponse方法抛出NotSupportException异常的解决方法
- ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction的问题解决(转)
- 解决weblogic抛出的ClassNotFoundException: org.hibernate.hql.ast.HqlToken异常
- mysql Lock wait timeout exceeded; try restarting transaction解决
- The type com.fasterxml.jackson.core.JsonProcessingException异常解决
- mysql死锁,等待资源,事务锁,Lock wait timeout exceeded; try restarting transaction解决
- 关于Servlet中连接mysql抛出ClassNotFoundException这个异常的解决方法
- 【spring源码学习】spring配置的事务方式是REQUIRED,但业务层抛出TransactionRequiredException异常问题