数据库的打开模式:
在database.h中有一枚举定义,如下:
enum dbAccessType {dbReadOnly,
dbAllAccess,
dbConcurrentRead,
dbConcurrentUpdate};
在dbDatabase构造函数中有相应的初始化参数,构造函数如下:
dbDatabase(dbAccessType type = dbAllAccess,
size_t dbInitSize = dbDefaultInitDatabaseSize,
size_t dbExtensionQuantum = dbDefaultExtensionQuantum,
size_t dbInitIndexSize = dbDefaultInitIndexSize,
int nThreads = 1
// Do not specify the following parameter - them are used only for checking
// that application and FastDB library were built with the
// same compiler options (-DNO_PTHREADS and -REPPLICATION_SUPPORT)
// Mismached parameters should cause linker error
#ifdef NO_PTHREADS
, dbThreadMode threadMode = dbNotUsePthreads
#endif
#ifdef REPLICATION_SUPPORT
, dbReplicationMode replicationMode = dbReplicated
#endif
);
如: dbDatabase db(dbDatabase::dbConcurrentRead);
数据库打开模式详解
本文介绍了数据库的不同打开模式,包括只读、全部访问、并发读取和并发更新等,并提供了dbDatabase构造函数的具体参数说明。
2994

被折叠的 条评论
为什么被折叠?



