aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-12-27 06:10:35 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-12-27 06:10:35 +0500
commit799a64f220c19a95ee35e31fb4ebdd5f82fc4c53 (patch)
tree956d7aebddd9393b80f71edef46771409a4698c7 /plugins/mod_storage_sql.lua
parent7390dbb331076a24ad776e4197c0c94fde6e3717 (diff)
downloadprosody-799a64f220c19a95ee35e31fb4ebdd5f82fc4c53.tar.gz
prosody-799a64f220c19a95ee35e31fb4ebdd5f82fc4c53.zip
mod_storage_sql: Call commit() after all SQL statements, including SELECT, to get SQLite to drop its locks.
Diffstat (limited to 'plugins/mod_storage_sql.lua')
-rw-r--r--plugins/mod_storage_sql.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index e5d5e86c..12c8eebe 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -55,9 +55,9 @@ do -- process options to get a db connection
if count == 0 then
local stmt = assert(connection:prepare("CREATE TABLE `Prosody` (`host` TEXT, `user` TEXT, `store` TEXT, `key` TEXT, `subkey` TEXT, `type` TEXT, `value` TEXT);"));
assert(stmt:execute());
- assert(connection:commit());
module:log("debug", "Initialized new SQLite3 database");
end
+ assert(connection:commit());
--print("===", json.stringify())
end
end
@@ -132,7 +132,7 @@ function keyval_store:get(username)
end
end
end
- return haveany and result or nil;
+ return commit(haveany and result or nil);
end
function keyval_store:set(username, data)
user,store = username,self.store;
@@ -182,7 +182,7 @@ function map_store:get(username, key)
end
end
end
- return haveany and result or nil;
+ return commit(haveany and result or nil);
end
function map_store:set(username, key, data)
user,store = username,self.store;