Hey guys,
so now I'm at the point, where I need to use a Transaction Manager.
Assume I have something like the following code:
$item = Item::findFirst(...);
$new = new Model1();
if (!$new->create()) {
// do rollback
}
$new2 = new Model2();
...
if (!$new->create()) {
// do rollback
}
if ($item-->getID() == 1) {
if (!$item->delete()) {
// do rollback.
}
} else {
$item->setCount(1);
if (!$item->save()) {
// do rollback
}
}
Now is it enough to use Manual Transactions? Or should I use Isolated Transaction?
If it helps, this kind of Code is in nearly every Action or Library Function and when everything is done, it should be a Browsergame.