Make deletion atomic using transactions even in case of recursive deletions
This commit is contained in:
parent
e6db7787ef
commit
7bf2386851
@ -344,11 +344,11 @@ abstract class AbstractCommonClubsModel
|
|||||||
$q->delete($factory->getTableName());
|
$q->delete($factory->getTableName());
|
||||||
$q->where("id = {$this->id}");
|
$q->where("id = {$this->id}");
|
||||||
|
|
||||||
$db->transactionStart();
|
$db->transactionStart(true);
|
||||||
$this->prepareDelete($db);
|
$this->prepareDelete($db);
|
||||||
$db->setQuery($q);
|
$db->setQuery($q);
|
||||||
$db->execute();
|
$db->execute();
|
||||||
$db->transactionCommit();
|
$db->transactionCommit(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,7 +21,7 @@ class ClubsViewTest extends HtmlView
|
|||||||
|
|
||||||
$this->club = $this->clubs[0];
|
$this->club = $this->clubs[0];
|
||||||
|
|
||||||
$c = $this->club;
|
$c = $factory->loadById(1);
|
||||||
$p = $c->getPresident();
|
$p = $c->getPresident();
|
||||||
$id = $p->getId();
|
$id = $p->getId();
|
||||||
|
|
||||||
@ -36,9 +36,9 @@ class ClubsViewTest extends HtmlView
|
|||||||
// $np->save();
|
// $np->save();
|
||||||
$np->getId();
|
$np->getId();
|
||||||
|
|
||||||
$np = $c->getPlaces()[1];
|
$np = $c->getPlaces()[2];
|
||||||
$np->getName();
|
$np->getName();
|
||||||
$np->setName('foo2 with new Name');
|
// $np->setName('foo2 with new Name');
|
||||||
// $np->save();
|
// $np->save();
|
||||||
// $np->delete();
|
// $np->delete();
|
||||||
$this->log = $np;
|
$this->log = $np;
|
||||||
|
Loading…
Reference in New Issue
Block a user