Skip to content

Commit 773d7b5

Browse files
committed
Don't auto start transactions
1 parent a9d5d84 commit 773d7b5

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/NodeTrait.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,39 +46,25 @@ trait NodeTrait
4646
public static function bootNodeTrait()
4747
{
4848
static::saving(function ($model) {
49-
$model->getConnection()->beginTransaction();
50-
5149
return $model->callPendingAction();
5250
});
5351

54-
static::saved(function ($model) {
55-
$model->getConnection()->commit();
56-
});
57-
5852
static::deleting(function ($model) {
59-
$model->getConnection()->beginTransaction();
60-
6153
// We will need fresh data to delete node safely
6254
$model->refreshNode();
6355
});
6456

6557
static::deleted(function ($model) {
6658
$model->deleteDescendants();
67-
68-
$model->getConnection()->commit();
6959
});
7060

7161
if (static::usesSoftDelete()) {
7262
static::restoring(function ($model) {
73-
$model->getConnection()->beginTransaction();
74-
7563
static::$deletedAt = $model->{$model->getDeletedAtColumn()};
7664
});
7765

7866
static::restored(function ($model) {
7967
$model->restoreDescendants(static::$deletedAt);
80-
81-
$model->getConnection()->commit();
8268
});
8369
}
8470
}
@@ -1140,11 +1126,12 @@ protected function dirtyBounds()
11401126
{
11411127
$this->original[$this->getLftName()] = null;
11421128
$this->original[$this->getRgtName()] = null;
1129+
11431130
return $this;
11441131
}
11451132

11461133
/**
1147-
* @param NodeTrait $node
1134+
* @param self $node
11481135
*
11491136
* @return $this
11501137
*/
@@ -1158,7 +1145,7 @@ protected function assertNotDescendant(self $node)
11581145
}
11591146

11601147
/**
1161-
* @param NodeTrait $node
1148+
* @param self $node
11621149
*
11631150
* @return $this
11641151
*/

0 commit comments

Comments
 (0)