FC-82 Allow retries when write to database fails due to optimistic locking

Added OptimisticLockException which is thrown if optimistic lock fails i.e. condition check on 'version' attribute is violated

Signed-off-by: Steffan Westcott <steffan.westcott@clicktravel.com>