added shared cache support to sqlite

This commit is contained in:
Guenter Obiltschnig 2008-03-26 09:11:18 +00:00
parent 5d5c7a0586
commit 6827e13c0f
3 changed files with 13 additions and 1 deletions

View File

@ -8,7 +8,8 @@
include $(POCO_BASE)/build/rules/global
SYSFLAGS += -DTHREADSAFE -DNO_TCL -DSQLITE_DISABLE_LFS
SYSFLAGS += -DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK \
-DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_TCL_VARIABLE
objects = Binder Extractor SessionImpl Connector \
SQLiteException SQLiteStatementImpl Utility \

View File

@ -73,6 +73,10 @@ public:
static void unregisterConnector();
/// Unregisters the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory.
static void enableSharedCache(bool flag = true);
/// Enables or disables SQlite shared cache mode
/// (see http://www.sqlite.org/sharedcache.html for a discussion).
};

View File

@ -37,6 +37,7 @@
#include "Poco/Data/SQLite/Connector.h"
#include "Poco/Data/SQLite/SessionImpl.h"
#include "Poco/Data/SessionFactory.h"
#include "sqlite3.h"
namespace Poco {
@ -75,4 +76,10 @@ void Connector::unregisterConnector()
}
void Connector::enableSharedCache(bool flag)
{
sqlite3_enable_shared_cache(flag ? 1 : 0);
}
} } } // namespace Poco::Data::SQLite