DESCRIPTION

JCBC-708: Exception for most probable lock failures

Motivation
----------
For lock related operations, the server doesn't have an explicit error
code for lock-specific errors (like the key is already locked or the cas
provided to unlock is wrong). It returns TEMPFAIL. Another transient
error code is BUSY, where we are sure this is not related to locks.

Distinguish between these two by introducing a new Exception. Don't hide
the ambiguity by returning a CASMismatchException (when the actual error
could be another transient one).

Modifications
-------------
Added new TemporaryLockFailureException, thrown when receiving TEMPFAIL.

BREAKING: unlock now throws TemporaryLockFailureException when the cas
doesn't match, because the server doesn't let us know for sure, so a
CASMismatchException could hide another problem.

Amended tests and added a test for double locking failure.

Results
-------
Client can be sure a transient error is not related to locks when
receiving a TemporaryFailureException.
On the other hand, lock problems are the most probable cause for the new
exception, TemporaryLockFailureException.
Unit tests and integration test pass.

Change-Id: I53c6fc1db480ec212b399b01e8bff72bb73e7bf1


COMMENTS

author: Estrella Humphrey
date: 2015-02-11 15:45:43.518000000

Uploaded patch set 2.

-------------------------------------
author: Estrella Humphrey
date: 2015-02-11 15:46:01.419000000

Patch Set 2: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2015-02-11 15:47:22.555000000

Patch Set 2: Code-Review+2

-------------------------------------
