我正在使用 domino appdev pack 1.0.7 Java API 来从数据库中读取文档。目前仅尝试 Domino AppDev Pack 中的示例代码。这是代码:
Server server = new Server('testappdev.com.tw', 5000,
new File("ca.crt"),
new File("user.crt"),
new File("user.key"),
"",
"",
Executors.newSingleThreadExecutor());
Database client = server.useDatabase("test.nsf");
String query = "'Contact' and FirstName = 'fname'";
List<Document> responseDocs = client.readDocuments(query).get();
当查询有结果文档时它工作正常,但是当查询没有结果文档时它在下面出现异常。
java.util.concurrent.ExecutionException: com.hcl.domino.db.model.BulkOperationException: Internal error
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:552)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:533)
at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:84)
at com.xred.DqlDemo.ReadIssue.main(ReadIssue.java:39)
Caused by: com.hcl.domino.db.model.BulkOperationException: Internal error
at com.hcl.domino.db.model.Database.noteToDocuments(Database.java:1881)
at com.hcl.domino.db.model.Database.access$000(Database.java:38)
at com.hcl.domino.db.model.Database$1.apply(Database.java:2006)
at com.hcl.domino.db.model.Database$1.apply(Database.java:2003)
at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:214)
at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:203)
at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:118)
at com.google.common.util.concurrent.MoreExecutors$5$1.run(MoreExecutors.java:991)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
查询没有结果文档时如何防止此错误?
谢谢!