/**
  * Releases lock after saving if there was one.
  * 
  * @param AggregateRoot $aggregate
  * 
  * @return void
  */
 public function save(AggregateRoot $aggregate)
 {
     $this->repository->save($aggregate);
     $this->lockManager->release($aggregate->getAggregateRootId());
 }