Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-07-15 19:01:57 +0400
committerVincent Petry <pvince81@owncloud.com>2014-07-15 19:01:57 +0400
commita8d95356ca58e7410a390e965c477cb918f96d9f (patch)
treea6fa766eb1f9341f2f22a29e9d44300228b2f093 /lib
parent61b5a770e443729bb2cd56b10ef587f313436a36 (diff)
parent10a29556b0eca1303fd48caccbc464e1b6231d05 (diff)
Merge pull request #8987 from owncloud/lastindexid-debug
[DEBUG] Test case for debugging the last index ID bug from Doctrine/MySQL
Diffstat (limited to 'lib')
-rw-r--r--lib/private/db.php10
-rw-r--r--lib/private/db/mdb2schemamanager.php6
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/private/db.php b/lib/private/db.php
index 6aaf31a30cd..221a369cad2 100644
--- a/lib/private/db.php
+++ b/lib/private/db.php
@@ -106,6 +106,16 @@ class OC_DB {
}
/**
+ * The existing database connection is closed and connected again
+ */
+ public static function reconnect() {
+ if(self::$connection) {
+ self::$connection->close();
+ self::$connection->connect();
+ }
+ }
+
+ /**
* @return \OC\DB\Connection
*/
static public function getConnection() {
diff --git a/lib/private/db/mdb2schemamanager.php b/lib/private/db/mdb2schemamanager.php
index a6d9e30cf80..d3e379c9417 100644
--- a/lib/private/db/mdb2schemamanager.php
+++ b/lib/private/db/mdb2schemamanager.php
@@ -24,8 +24,6 @@ class MDB2SchemaManager {
*/
public function __construct($conn) {
$this->conn = $conn;
- $this->conn->close();
- $this->conn->connect();
}
/**
@@ -150,6 +148,10 @@ class MDB2SchemaManager {
$this->conn->query($sql);
}
$this->conn->commit();
+
+ if ($this->conn->getDatabasePlatform() instanceof SqlitePlatform) {
+ \OC_DB::reconnect();
+ }
return true;
}
}