我在使用 Ektorp executeBulk 和 ExecuteAllOrNothing 函数对 Cloudant DB (CouchDB) 中的文档列表进行批量更新时遇到问题。
对于couchDbConnector.executeAllOrNothing(List<?> list)
,我收到如下错误:
org.ektorp.DbAccessException: 417:Expectation Failed
URI: /let-ut-app/_bulk_docs
Response Body:
null
at org.ektorp.http.StdResponseHandler.createDbAccessException(StdResponseHandler.java:44)
at org.ektorp.http.StdResponseHandler.error(StdResponseHandler.java:62)
at org.ektorp.http.RestTemplate.handleResponse(RestTemplate.java:98)
at org.ektorp.http.RestTemplate.post(RestTemplate.java:61)
at org.ektorp.impl.StdCouchDbConnector.executeBulk(StdCouchDbConnector.java:536)
at org.ektorp.impl.StdCouchDbConnector.executeAllOrNothing(StdCouchDbConnector.java:494)
如果我将相同的逻辑更改为使用 executeBulk,
couchDbConnector.executeBulk(List<?> list)
则错误消息如下所示:
org.ektorp.DbAccessException: 500:Internal Server Error
URI: /let-ut-app/_bulk_docs
Response Body:
{
"error" : "case_clause",
"reason" : "{12,11}",
"stack" : [ "fabric_doc_update:handle_message/3", "rexi_utils:process_mailbox/6", "rexi_utils:recv/6", "fabric_doc_update:go/3", "fabric:update_docs/3", "chttpd_db:db_req/2", "chttpd:handle_request/1", "mochiweb_http:headers/5" ]
}
at org.ektorp.http.StdResponseHandler.createDbAccessException(StdResponseHandler.java:44)
at org.ektorp.http.StdResponseHandler.error(StdResponseHandler.java:62)
at org.ektorp.http.RestTemplate.handleResponse(RestTemplate.java:98)
at org.ektorp.http.RestTemplate.post(RestTemplate.java:61)
at org.ektorp.impl.StdCouchDbConnector.executeBulk(StdCouchDbConnector.java:536)
at org.ektorp.impl.StdCouchDbConnector.executeBulk(StdCouchDbConnector.java:498)
请让我知道你们中是否有人遇到过这个问题以及您是如何解决的。
感谢你的帮助。
非常感谢!