[GRASS-SVN] r52829 - grass/trunk/lib/db/dbmi_base
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 21 12:48:49 PDT 2012
Author: mmetz
Date: 2012-08-21 12:48:48 -0700 (Tue, 21 Aug 2012)
New Revision: 52829
Modified:
grass/trunk/lib/db/dbmi_base/default_name.c
Log:
dblib: sqlite needs exclusive access to the folder with the database
Modified: grass/trunk/lib/db/dbmi_base/default_name.c
===================================================================
--- grass/trunk/lib/db/dbmi_base/default_name.c 2012-08-21 19:28:28 UTC (rev 52828)
+++ grass/trunk/lib/db/dbmi_base/default_name.c 2012-08-21 19:48:48 UTC (rev 52829)
@@ -111,7 +111,7 @@
G__make_mapset_element("dbf");
}
else if (strcmp(DB_DEFAULT_DRIVER, "sqlite") == 0) {
- /* Set default values and create dbf db dir */
+ /* Set default values and create sqlite db dir */
connection.driverName = "sqlite";
/*
@@ -119,8 +119,17 @@
* or per-map DBs in $MASPET/vector/mapname/sqlite.db (how to set that here?)
* or $MAPSET/sqlite/mapname.sql as with dbf?
*/
+
+ /* http://www.sqlite.org/lockingv3.html
+ * When SQLite creates a journal file on Unix, it opens the
+ * directory that contains that file and calls fsync() on the
+ * directory, in an effort to push the directory information to disk.
+ *
+ * -> have sqlite.db in a separate directory
+ */
connection.databaseName =
- "$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db";
+ "$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db";
+ G__make_mapset_element("sqlite");
db_set_connection(&connection);
}
else
More information about the grass-commit
mailing list