Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

CouchBase .NET SDK 2.3.3 Now Available!

DZone's Guide to

CouchBase .NET SDK 2.3.3 Now Available!

CouchBase's .NET SDK v2.3.3 is now out! Come see what's new in this release.

· Database Zone
Free Resource

Learn NoSQL for free with hands-on sample code, example queries, tutorials, and more.  Brought to you in partnership with Couchbase.

Today we are releasing a maintenance and bug fix release of the Couchbase .NET SDK. This is a follow-up release to 2.3.0 and 2.3.1 (there is no 2.3.2 release) and we suggest you upgrade accordingly. While largely a bug fix release, there are a couple of minor new features that we are releasing as well as an API rename that makes the older methods obsolete.

New Features and Changes

Asynchronous Batch Methods

We have added a new API of asynchronous methods for batching a number of operations on JSON documents. These allow you to use the familiar async/await paradigm to execute a list of operations in a non-blocking fashion:

 var documents = new List<IDocument<object>>
 {
    new Document<object>
    {
        Id = "UpsertAsync_Batch_doc1",
        Content = new {Name = "bob", Species = "Cat", Age = 5}
    },
    new Document<object> {Id = "UpsertAsync_Batch_doc2", Content = 10},
    new Document<object> {Id = "UpsertAsync_Batch_doc3", Content = new Cat {Name = "Cleo", Age = 10}}
 };
 var results = await _bucket.UpsertAsync(documents).ConfigureAwait(false);


Notice that we are specifying that the generic Type T is an object in this example? By doing this, we can combine documents of varying types; if you were to constrain T to a more specific type, then every document in the batch would need to be the same Type.

These methods have been added for the following operations:

  • GetDocumentsAsync: get a set of documents given a set of keys.
  • UpsertAsync: update an existing set of docs or insert them if the do not exist.
  • InsertAsync: insert a set of documents failing if they exist.
  • RemoveASync: remove a set of documents.
  • ReplaceAsync: replace a set of documents, failing if they do not exist.

Allow Programmatic Configuration for IO Services

Some time back, we released a new IO provider called MUX IO. However, we only supported configuration through App.config or Web.config files. Now you can programmatically configure your IO service:

var config = new ClientConfiguration
{
    Servers = new List<Uri>
    {
        new Uri(ConfigurationManager.AppSettings["bootstrapUrl"])
    }
};
config.ConnectionPoolCreator = ConnectionPoolFactory.GetFactory<ConnectionPool<MultiplexingConnection>>();
config.IOServiceCreator = IOServiceFactory.GetFactory<MultiplexingIOService>();
ClusterHelper.Initialize(config);


A big thanks to community member Petr Drastil for submitting a PR for this feature!

Upgrade NewtonSoft package to 8.0.3

We have finally upgraded from version 6.0.8 to 8.0.3 largely in support for a .NET Core compliant JSON serializer.

Rename GetWithLock to GetAndLock

This was done so that we could have some consistency across the various Couchbase SDKs (Java, PHP, etc). All GetWithLock methods have been flagged as "obsolete" using the ObsoleteAttribute .aspx). If you are using these methods you will get a compiler warning. Note that these methods will not be removed until a major version (3.x for example) of the SDK is released.

IPv6 Support

You can now set a global configuration so that the client will use only IPv6 entries when resolving a Fully Qualified Domain Name (FQDN). I would label this an "experimental" feature in that it has not been exhaustively tested, so caveat emptor! Unless you are using a pure IPv6 network, I would stay away from this feature!

Known Issues

There is one known issue that was discovered late in testing; Sub-Document commands may fail with a NotImplementedException during failover/swap/rebalance scenarios. This will be fixed in a later release — you can read more about it in Jira.

Release Notes: Couchbase .NET Client Library 2.3.3

  • [NCBC-1127] - Expose CAS in document fragments
  • [NCBC-1143] - Subdocument Exists always returns true
  • [NCBC-1146] - replace GetWithLock with GetAndLock
  • [NCBC-1148] - MemcachedBucket.CreateManager throws NotSupportedException
  • [NCBC-1149] - Correct issue in bucket reference counting
  • [NCBC-1151] - Subdocument - Singular Replace always fails
  • [NCBC-1154] - Calling ToString on QueryResult may throw NRE
  • [NCBC-1092] - Upgrade NewtonSoft dependency to 8.x
  • [NCBC-1116] - Add async/await methods for bulk operations
  • [NCBC-1118] - Allow programmatic configuration for IO services
  • [NCBC-1087] - IPv6 Support in Client Configuration
  • [NCBC-1150] - Subdocument - Lookup fails when getting hierarchical subdocument

Special Thanks

A special thanks to all community members who contributed to this release either by contributing a pull-request, answering or asking a question on forums, or creating a bug report or feature request on Jira, most notably Brant Burnett of CenterEdge Software.

How to get it

The SDK is available for download directly, through NuGet, or by cloning and pulling the Github repo:

The Getting Started with NoSQL Guide will get you hands-on with NoSQL in minutes with no coding needed. Brought to you in partnership with Couchbase.

Topics:
couchbase ,release ,json ,couchbase .net sdk ,.net ,sdk ,database ,nosql

Published at DZone with permission of Jeff Morris, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}