Make deletion atomic using transactions even in case of recursive deletions

This commit is contained in:
Christian Wolf 2019-05-23 18:05:16 +02:00
parent e6db7787ef
commit 7bf2386851
2 changed files with 6 additions and 6 deletions

View File

@ -344,11 +344,11 @@ abstract class AbstractCommonClubsModel
$q->delete($factory->getTableName());
$q->where("id = {$this->id}");
$db->transactionStart();
$db->transactionStart(true);
$this->prepareDelete($db);
$db->setQuery($q);
$db->execute();
$db->transactionCommit();
$db->transactionCommit(true);
}
/**

View File

@ -21,7 +21,7 @@ class ClubsViewTest extends HtmlView
$this->club = $this->clubs[0];
$c = $this->club;
$c = $factory->loadById(1);
$p = $c->getPresident();
$id = $p->getId();
@ -33,12 +33,12 @@ class ClubsViewTest extends HtmlView
$np = $pfactory->createNew();
$np->setName('MyName');
$np->setClub($c);
//$np->save();
// $np->save();
$np->getId();
$np = $c->getPlaces()[1];
$np = $c->getPlaces()[2];
$np->getName();
$np->setName('foo2 with new Name');
// $np->setName('foo2 with new Name');
// $np->save();
// $np->delete();
$this->log = $np;