Release notes

Release notes for the 2.0 version of the Java SDK.

Couchbase Java Client 2.0.2 GA (4 December 2014)

Version 2.0.2 GA is the second bug fix release of the 2.0 series. It provides a bunch of small enhancements, and some important bug fixes that improve the overall stability of the SDK.

New features and behavioral changes

This release contains the following enhancements:

  • JVMCBC-78: RxJava has been upgraded from a release candidate to 1.0.2 GA. This upgrade includes several bug fixes and improvements that can be found in the RxJava changelog.
  • JCBC-614: Added factory methods to construct a JsonArray from a List and a JsonObject from a Map.
  • JCBC-640: null handling for JsonObject and JsonArray has been improved and is now also covered in testing.
  • JCBC-644: For all blocking methods that return a scalar value, the actual blocking code has been optimized. It now does not have the overhead of a timeout() operator as well as BlockingObservable. This should noticeably improve garbage collection behavior on smaller or high traffic heaps.
  • JCBC-638: Methods in the JsonDocument class and similar classes now properly check that the id is not null or empty and throws an IllegalArgumentException if it is. In addition, the same check is applied so that negative expiration times are not allowed.


This release contains the following bug fixes:

  • JCBC-624: Reading and writing small long values resulted in exceptions when reading them back (through JsonObject and JsonArray).
  • JCBC-559: Depending on the Server version used, during rebalance and failure scenarios, view responses return different HTTP error codes that indicate transient failures that can be retried. This change aligns the 2.0 SDK with the behavior already in place for the 1.4 SDK.
  • JCBC-583: Fixes a Netty I/O memory pool leak that was reported during the view JSON decode process.
  • JVMCBC-79: On a multinode cluster, opening more than one bucket now works more reliably than before. Previously there was a possibility that the wrong node was picked to fetch the initial bucket configuration, leading to a never completed Observable on openBucket().
  • JVMCBC-68: A race condition has been fixed during rebalance that when a new node has been added to the configuration, the locator for key-value requests still used an outdated one. This led to exceptions in the core library which in turn rendered it unusable.
  • JVMCBC-77: Fixes a Netty I/O reference count issue during key-value write operations. No exceptions show up in the logs, because they are swallowed by Netty. Proper listeners have also been added to the SDK to report such errors from the future on very prominently in the logs.
  • JVMCBC-65: View and N1QL queries were only distributed to one node in the cluster, leading to suboptimal performance. This fix makes sure that the queries are evenly distributed throughout all connected nodes in the cluster.

Couchbase Java Client 2.0.1 GA (4 November 2014)

Version 2.0.1 GA is the first bug fix release of the 2.0 series. It provides a series of bug fixes and small enhancements. We encourage all users on 2.0.0 GA (and earlier) to upgrade.

New features and behavioral changes

This release contains the following enhancements:

  • JCBC-575: Added support for a RawJsonDocument.

    This document type has been added so that custom JSON libraries (like Jackson) can be used to directly insert a JSON value. It is supposed to be used like this, and can be used in combination with the other JSON documents:

    // Create the RawJsonDocument with a JSON string
    bucket.upsert(RawJsonDocument.create("id", "{\"hello\": true}"));
    // Load the document raw again
    // Prints RawJsonDocument{id='id', cas=123102208173, expiry=0, content={"hello": true}}
    System.out.println(bucket.get("id", RawJsonDocument.class));
    // Load the document through a JsonDocument and benefit from parsing
    // Prints true
  • JCBC-602: CAS mismatches are handled and exposed when set on the remove() calls.

    When a remove() operation is executed and the CAS value is set, proper checks are now performed. Here is an example that manually modifies the CAS to simulate trying to remove an already changed one with an outdated CAS value:

    // Create any document
    JsonDocument created = bucket.upsert(JsonDocument.create("docid", JsonObject.create()));
    // Remove it with the wrong cas value set (simulating an already changed one)
    bucket.remove(JsonDocument.from(created, 132344545L));

    The incorrect CAS value causes a CASMismatchException to be thrown:

    Exception in thread "main"
      at rx.internal.operators.OperatorMap$1.onNext(
  • JVMCBC-56: RxJava has been upgraded to 1.0.0.RC9.

    The RC9 release brings additional bug fixes and stability improvements over the RC3 release that was shipped with 2.0.0 GA. We expect the Couchbase Java SDK 2.0.2 to ship with the 1.0.0 GA release shortly after its announcement.


This release contains the following bug fixes:

  • JVMCBC-42 (prev. JCBC-563): Rewriting endpoint handlers to prevent views from locking up.

    Users reported that under certain conditions, View responses would hang the threads and application intervention was needed to bring it back to life (or a timeout kicks in). Changes were made to the application to prevent those kinds of hang-ups.

  • JVMCBC-43: Fixes ConcurrentModificationException on disconnect with more buckets.
  • JVMCBC-45: Give configuration loading a chance to be retried.

    When applications were running for a longer time, exceptions would be raised during certain scenarios, leading to a death of the core engine threading. These messages were used during configuration reloading and are now properly rescheduled.

  • JVMCBC-62: Make Diagnostics resilient for not found classes.

    The newly added Diagnostics helper class was optionally using MXBeans from the com/sun package, but did not check whether those are available. This had the side effect of preventing start-up on JBoss Wildfly and IBM JVM type systems. Proper guards are now in place to prevent this.

  • JVMCBC-41: Fix buffer leak in DefaultFullBinaryMemcacheRequest/Response
  • JCBC-587: Never quote start/endKeyDocId in the ViewQuery
  • JCBC-606: Release buffers in transcoders + tests
  • JCBC-610: Fix decoding of BinaryDocument
  • JCBC-582: Bucket details loading fails if the bucket is greater than 2 GB

Known issues

This release has the following known issues:

  • JCBC-583: View queries leak Netty byte buffers, leading to more garbage collection than needed.

Couchbase Java Client 2.0.0 GA (19 September 2014)

Version 2.0.0 GA is the first stable release of the 2.0.0 series. It is a complete rewrite compared to the 1.* series.

New features and behavioral changes

Here are some of the highlights in this release:

  • Reworked API to be document oriented and cross-platform with other SDKs
  • Asynchronous, reactive API based on RxJava
  • Synchronous wrapper around the asynchronous API for convenience
  • Support for Couchbase Server 3.0, including encryption via Secure Sockets Layer (SSL)
  • Stream-based view and N1QL query APIs
  • First-class JSON support, as well as Legacy and other optimized documents
  • Interoperability with other Couchbase 2.0 SDKs without code changes

Known issues

This release has the following known issues:

  • JCBC-563: View query will lock up after the first few attempts.

    Sometimes a view response gets stuck in the core. Subsequent requests have been identified to work again, so a workaround until it is fixed in the next bug-fix release is to retry after the operation times out. Make sure to apply a timeout when using the asynchronous API and maybe also use a shorter timeout than the default, which is 75 seconds for views.

    A shorter timeout can be applied:

    ViewResult query = bucket.query(ViewQuery.from("design", "view"), 10, TimeUnit.SECONDS);

    If the asynchronous API is used, make sure to apply a timeout:

    Observable<AsyncViewResult> result = bucket
        .query(ViewQuery.from("design", "view"))
        .timeout(10, TimeUnit.SECONDS);