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>
Would "finally" help to explain what is happening just in case additional code reduces the clarity of what is happening.