Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Commit

Permalink
Merge pull request #9 from GeniusesOfSymfony/ProPheT777-patch-1
Browse files Browse the repository at this point in the history
Fix transaction
  • Loading branch information
Johann Saunier committed Jan 21, 2015
2 parents 941a9db + 003d4b3 commit 08677e9
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions Domain/AbstractAclManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,7 @@ protected function doApplyPermission(MutableAclInterface $acl, PermissionContext
$size = count($aceCollection) - 1;
reset($aceCollection);

//If transaction already
if($this->connection->isTransactionActive()){
$this->doUpdatePermission($size, $replaceExisting, $aceCollection, $context, $acl, $field, $type);
}else{
try{
$this->connection->beginTransaction();
$this->doUpdatePermission($size, $replaceExisting, $aceCollection, $context, $acl, $field, $type);
$this->connection->commit();
} catch(\Exception $e){
$this->connection->rollBack();
throw $e;
}
}
$this->doUpdatePermission($size, $replaceExisting, $aceCollection, $context, $acl, $field, $type);
}

/**
Expand Down

0 comments on commit 08677e9

Please sign in to comment.