[JCBC-143] Prepend should not require CAS Created: 08/Nov/12  Updated: 21/Dec/12  Resolved: 21/Dec/12

Status: Resolved
Project: Couchbase Java Client
Component/s: Documentation
Affects Version/s: 1.0.3
Fix Version/s: 1.1.1
Security Level: Public

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Michael Nitschinger
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SPY-124 append/incr/decr/add/replace should n... Resolved

 Description   
Hopefully this is just a doc bug and not in the actual code, but all of the atomic updates including prepend (http://www.couchbase.com/docs/couchbase-sdk-java-1.0/couchbase-sdk-java-update-prepend.html) should not require CAS. That significantly defeats their performance effectiveness.

If the function *does* require CAS, we should document that a CAS id of 0 will override the requirement to get the key again as in this example:
client.prepend(casv.getCas(),"samplekey", "prependedstring");


 Comments   
Comment by Michael Nitschinger [ 09/Nov/12 ]
This is not a doc bug, both prepend and append require CAS values.

So is this still a doc enhancement or should we consider enhancing the library?
Comment by Perry Krug [ 10/Nov/12 ]
I think a simple doc enhancement to inform the user that they can replace the actual CAS call with a 0 to avoid the second round-trip to the server. There are a few situations where CAS would be appropriate for these ops, so it doesn't make sense to remove it from the library, but the most common case is to use them as atomic operations and therefore not need CAS...so the doc update should just make that clearer. Please make sure to note it on the various other atomic ops (incr/dev/append/touch/)
Comment by Michael Nitschinger [ 21/Dec/12 ]
This is a duplicate for JCBC-196, see the process over there.
Generated at Wed Sep 03 00:53:47 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.