summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-09-16 17:29:34 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-17 11:07:59 +0200
commit7c66328381dd0e2ce5e7ab1e4477593bc79ed3ad (patch)
treef276b254be998feabf290d875e19a3493f36daab /lib
parentc9397dffea9da757d18514e8eb303c3c88756c84 (diff)
downloadnextcloud-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.php17
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();
- }
}