本文整理汇总了C++中MojDbReq::end方法的典型用法代码示例。如果您正苦于以下问题:C++ MojDbReq::end方法的具体用法?C++ MojDbReq::end怎么用?C++ MojDbReq::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MojDbReq
的用法示例。
在下文中一共展示了MojDbReq::end方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateLocale
MojErr MojDb::updateLocale(const MojChar* locale, MojDbReqRef req)
{
MojAssert(locale);
MojLogTrace(s_log);
MojErr err = beginReq(req, true);
MojErrCheck(err);
MojString oldLocale;
err = getLocale(oldLocale, req);
MojErrCheck(err);
MojString newLocale;
err = newLocale.assign(locale);
MojErrCheck(err);
MojErr updateErr = err = updateLocaleImpl(oldLocale, newLocale, req);
MojErrCatchAll(err) {
err = req->abort();
MojErrCheck(err);
err = m_kindEngine.close();
MojErrCheck(err);
MojDbReq openReq;
err = beginReq(openReq, true);
MojErrCheck(err);
err = m_kindEngine.open(this, openReq);
MojErrCheck(err);
err = openReq.end();
MojErrCheck(err);
MojErrThrow(updateErr);
}
return MojErrNone;
}
示例2: updateLocaleImpl
MojErr MojDb::updateLocaleImpl(const MojString& oldLocale, const MojString& newLocale, MojDbReq& req)
{
if (oldLocale != newLocale) {
MojErr err = m_kindEngine.updateLocale(newLocale, req);
MojErrCheck(err);
err = updateState(LocaleKey, newLocale, req);
MojErrCheck(err);
}
MojErr err = req.end();
MojErrCheck(err);
return MojErrNone;
}
示例3: putConfig
MojErr MojDb::putConfig(MojObject* begin, const MojObject* end, MojDbReq& req, MojDbPutHandler& handler)
{
MojAssert(begin || begin == end);
MojAssert(end >= begin);
MojLogTrace(s_log);
MojErr err = beginReq(req, true);
MojErrCheck(err);
for (MojObject* i = begin; i != end; ++i) {
err = handler.put(*i, req);
MojErrCheck(err);
}
err = req.end();
MojErrCheck(err);
return MojErrNone;
}
示例4: drop
MojErr MojDb::drop(const MojChar* path)
{
MojAssert(path);
MojLogTrace(s_log);
MojErr err = requireOpen();
MojErrCheck(err);
MojDbReq req;
err = req.begin(this, true);
MojErrCheck(err);
err = m_storageEngine->drop(path, req.txn());
MojErrCheck(err);
err = req.end();
MojErrCheck(err);
err = close();
MojErrCheck(err);
return MojErrNone;
}
示例5: open
MojErr MojDb::open(const MojChar* path, MojDbStorageEngine* engine)
{
MojAssert(path);
MojLogTrace(s_log);
MojErr err = requireNotOpen();
MojErrCheck(err);
MojLogInfo(s_log, _T("opening: '%s'..."), path);
MojAutoCloser<MojDb> closer(this);
m_isOpen = true;
// check the database version number and bail if there's a mismatch
err = checkDbVersion(path);
MojErrCheck(err);
// engine
if (engine == NULL) {
err = createEngine();
MojErrCheck(err);
MojAssert(m_storageEngine.get());
err = m_storageEngine->configure(m_conf);
MojErrCheck(err);
err = m_storageEngine->open(path);
MojErrCheck(err);
} else {
m_storageEngine.reset(engine);
}
MojDbReq req;
err = req.begin(this, true);
MojErrCheck(err);
// db
MojLogInfo(s_log, _T("Open Database: '%s'"), ObjDbName);
err = m_storageEngine->openDatabase(ObjDbName, req.txn(), m_objDb);
MojErrCheck(err);
MojAssert(m_objDb.get());
// seq
MojLogInfo(s_log, _T("Open Database: '%s'"), IdSeqName);
err = m_storageEngine->openSequence(IdSeqName, req.txn(), m_idSeq);
MojErrCheck(err);
MojAssert(m_idSeq.get());
// kinds
MojLogInfo(s_log, _T("Open Kind Engine"));
err = m_kindEngine.open(this, req);
MojLogInfo(s_log, _T("Kind Opened..."));
MojErrCheck(err);
// perms
MojLogInfo(s_log, _T("Open Permissions"));
err = m_permissionEngine.open(m_conf, this, req);
MojErrCheck(err);
// quota
err = m_quotaEngine.open(m_conf, this, req);
MojErrCheck(err);
err = req.end();
MojErrCheck(err);
// idgen
err = m_idGenerator.init();
MojErrCheck(err);
closer.release();
MojLogInfo(s_log, _T("open completed"));
return MojErrNone;
}