【问题标题】:Couchbase setting value沙发底座设置值
【发布时间】:2017-08-11 08:22:08
【问题描述】:

从我的 java 代码中存储到 couchbase 中,以确保它正确保存在 couchbase 中,使用以下代码块。

OperationFuture< Boolean > result = couchClient.set(<key>,<value> );
        while( !result.isDone() ) {
            try {
               Thread.sleep( 5 );
            }catch( InterruptedException e ) {
                errorLog.error( "Error occurred while setting in couchbase " + e.getMessage() );
            }
    }

与其他人一起检查是否有更好的方法来确保对象正确存储在沙发库中。

【问题讨论】:

  • 这似乎是在使用较旧的(并且已停产)1.x Java 客户端。最好在撰写本文时移至 2.4.7 的 2.x。
  • 谢谢。我将更改库并尝试。

标签: key couchbase setting


【解决方案1】:

处理这个问题的最好方法是 Couchbase 所说的耐久性要求,它可以用于 2.x 客户端中的 .upsert() 之类的操作。 Couchbase Java documentation 对此进行了介绍,并附有指向 concept 上更多信息的链接。

【讨论】:

  • 谢谢。我会仔细阅读这些文件。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多