[JCBC-61] Expose returned CAS value in CASResponse when available from binary protocol Created: 06/Jun/12  Updated: 25/Jun/13  Resolved: 25/Jun/13

Status: Resolved
Project: Couchbase Java Client
Component/s: Core
Affects Version/s: 1.1dp
Fix Version/s: 1.1.8
Security Level: Public

Type: Improvement Priority: Major
Reporter: Perry Krug Assignee: Michael Nitschinger
Resolution: Won't Fix Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Customer request to add the capability to retrieve new cas value after a cas() operation to avoid a subsequent gets()

 Comments   
Comment by Michael Nitschinger [ 29/Nov/12 ]
This may already be implemented, need to check.
Comment by Michael Nitschinger [ 25/Jun/13 ]
Hey, this is already the case when you use asyncCAS!

it returns an OperationFuture and this always has the getCas() method on it..

So this works:

    OperationFuture<Boolean> f = client.set("foo1", "bar");

    System.out.println(f.getCas());

    OperationFuture<CASResponse> f2 = client.asyncCAS("foo1", f.getCas(), "bar1");

    System.out.println(f2.getCas());

Hope this helps,
Michael
Comment by Michael Nitschinger [ 25/Jun/13 ]
Already works with asyncCAS
Generated at Thu Aug 21 06:56:32 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.