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->where("id = {$this->id}");
|
||||
|
||||
$db->transactionStart();
|
||||
$db->transactionStart(true);
|
||||
$this->prepareDelete($db);
|
||||
$db->setQuery($q);
|
||||
$db->execute();
|
||||
$db->transactionCommit();
|
||||
$db->transactionCommit(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
|
||||
@ -36,9 +36,9 @@ class ClubsViewTest extends HtmlView
|
||||
// $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;
|
||||
|
Loading…
Reference in New Issue
Block a user