diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-09-16 17:29:34 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-17 11:07:59 +0200 |
commit | 7c66328381dd0e2ce5e7ab1e4477593bc79ed3ad (patch) | |
tree | f276b254be998feabf290d875e19a3493f36daab /lib | |
parent | c9397dffea9da757d18514e8eb303c3c88756c84 (diff) | |
download | nextcloud-server-7c66328381dd0e2ce5e7ab1e4477593bc79ed3ad.tar.gz nextcloud-server-7c66328381dd0e2ce5e7ab1e4477593bc79ed3ad.zip |
Remove the need for the transaction in the database locking backend
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/lock/dblockingprovider.php | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/private/lock/dblockingprovider.php b/lib/private/lock/dblockingprovider.php index f3e684d0b4d..6f14b7806ea 100644 --- a/lib/private/lock/dblockingprovider.php +++ b/lib/private/lock/dblockingprovider.php @@ -76,11 +76,10 @@ class DBLockingProvider extends AbstractLockingProvider { * @throws \OCP\Lock\LockedException */ public function acquireLock($path, $type) { - if ($this->connection->inTransaction()){ + if ($this->connection->inTransaction()) { $this->logger->warning("Trying to acquire a lock for '$path' while inside a transition"); } - $this->connection->beginTransaction(); $this->initLockField($path); if ($type === self::LOCK_SHARED) { $result = $this->connection->executeUpdate( @@ -93,7 +92,6 @@ class DBLockingProvider extends AbstractLockingProvider { [$path] ); } - $this->connection->commit(); if ($result !== 1) { throw new LockedException($path); } @@ -146,17 +144,4 @@ class DBLockingProvider extends AbstractLockingProvider { } $this->markChange($path, $targetType); } - - /** - * cleanup empty locks - */ - public function cleanEmptyLocks() { - $this->connection->executeUpdate( - 'DELETE FROM `*PREFIX*file_locks` WHERE `lock` = 0' - ); - } - - public function __destruct() { - $this->cleanEmptyLocks(); - } } |