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>
FC-82 Updated code following review

Signed-off-by: Steffan Westcott <steffan.westcott@clicktravel.com>
Merge pull request #27 from clicktravel-steffan/master

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