本文整理匯總了C++中BeginTransaction函數的典型用法代碼示例。如果您正苦於以下問題:C++ BeginTransaction函數的具體用法?C++ BeginTransaction怎麽用?C++ BeginTransaction使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了BeginTransaction函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: BeginTransaction
void CRUUnAuditRefreshTaskExecutor::Recompute()
{
// ?????
// Temporary - Should be removed when read commited from unaudited table is implemented
if (FALSE == IsTransactionOpen())
{
BeginTransaction();
}
CDMPreparedStatement *pStat = PrepareRecomputeMV();
// ?????
// Temporary - Should be removed when read commited from unaudited table is implemented
CommitTransaction();
BeginTransaction();
ExecuteRecomputeMV(pStat);
// ?????
// Temporary - Should be removed when read commited from unaudited table is implemented
CommitTransaction();
TESTPOINT2(CRUGlobals::TESTPOINT104, GetRootMVName());
if (TRUE == isPopindex_)
{
SetState(EX_POPINDEX);
}
else
{
SetState(EX_EPILOGUE);
}
}
示例2: BeginTransaction
void CRUAuditRefreshTaskExecutor::Recompute()
{
// TEMPORARY: Commented out until the privilege-skipping lock
// is implemented
// LockMV();
if (FALSE == IsTransactionOpen())
{
BeginTransaction();
}
// Decouple prepare and execute to separate transactions.
CDMPreparedStatement *pStat = PrepareRecomputeMV();
CommitTransaction();
BeginTransaction();
ExecuteRecomputeMV(pStat);
if (TRUE == isDeleteMultiTxnContext_)
{
// Delete all rows from the context log table
auditRefreshTEDynamicContainer_.
DirectExecStatement(DELETE_MULT_TXN_CTX_TBL);
}
if (TRUE == isPopindex_)
{
CommitTransaction();
SetState(EX_POPINDEX);
}
else
{
SetState(EX_REMOTE_END);
}
}
示例3: GetTargetFrame
/* static */ bool
WheelTransaction::WillHandleDefaultAction(WidgetWheelEvent* aWheelEvent,
nsWeakFrame& aTargetWeakFrame)
{
nsIFrame* lastTargetFrame = GetTargetFrame();
if (!lastTargetFrame) {
BeginTransaction(aTargetWeakFrame.GetFrame(), aWheelEvent);
} else if (lastTargetFrame != aTargetWeakFrame.GetFrame()) {
EndTransaction();
BeginTransaction(aTargetWeakFrame.GetFrame(), aWheelEvent);
} else {
UpdateTransaction(aWheelEvent);
}
// When the wheel event will not be handled with any frames,
// UpdateTransaction() fires MozMouseScrollFailed event which is for
// automated testing. In the event handler, the target frame might be
// destroyed. Then, the caller shouldn't try to handle the default action.
if (!aTargetWeakFrame.IsAlive()) {
EndTransaction();
return false;
}
return true;
}
示例4: fsal_posixdb_lockHandleForUpdate
/**
* @brief Lock the line of the Handle table with inode & devid defined in p_info
*
* @param p_conn
* Database connection
* @param p_info
* Information about the file
*
* @return ERR_FSAL_POSIXDB_NOERR if no error,
* another error code else.
*/
fsal_posixdb_status_t fsal_posixdb_lockHandleForUpdate(fsal_posixdb_conn * p_conn, /* IN */
fsal_posixdb_fileinfo_t *
p_info /* IN */ )
{
PGresult *p_res;
char devid_str[MAX_DEVICEIDSTR_SIZE];
char inode_str[MAX_INODESTR_SIZE];
const char *paramValues[2];
CheckConn(p_conn);
BeginTransaction(p_conn, p_res);
snprintf(devid_str, MAX_DEVICEIDSTR_SIZE, "%lli", (long long int)p_info->devid);
snprintf(inode_str, MAX_INODESTR_SIZE, "%lli", (long long int)p_info->inode);
paramValues[0] = devid_str;
paramValues[1] = inode_str;
p_res = PQexecPrepared(p_conn, "lookupHandleByInodeFU", 2, paramValues, NULL, NULL, 0);
CheckResult(p_res);
PQclear(p_res);
/* Do not end the transaction, because it will be closed by the next call to a posixdb function */
ReturnCodeDB(ERR_FSAL_POSIXDB_NOERR, 0);
}
示例5: EndTimer
void CRUUnAuditRefreshTaskExecutor::Epilogue()
{
EndTimer();
BeginTransaction();
if (TRUE == GetRefreshTask()->NeedToExecuteInternalRefresh())
{
if (CDDObject::eON_STATEMENT == GetRootMVType())
{
EpilogueHandleOnStatementMV();
}
// Set the MV(s)/indexes back available
ResetObjectsAvailable();
}
FinalMetadataUpdate();
CommitTransaction();
TESTPOINT2(CRUGlobals::TESTPOINT107, GetRootMVName());
LogClosureMessage();
SetState(EX_COMPLETE);
}
示例6: RUASSERT
void CRUUnAuditRefreshTaskExecutor::PopulateIndexes()
{
RUASSERT(TRUE == isPopindex_);
if (0 == numOfIndexes_)
{
return;
}
// ?????
// Temporary - Should be removed when read commited from unaudited table is implemented
BeginTransaction();
#ifdef _DEBUG
CDSString msg(
"\nPopulating the secondary indexes of materialized view "
+ GetRootMVName() + "...\n");
CRUGlobals::GetInstance()->
LogDebugMessage(CRUGlobals::DUMP_POPINDEX,"",msg);
#endif
ExecuteIndexStatmenents(*pUnAuditPopIndexdynamicContainer_, IDS_RU_POPINDEX_FAILED);
// ?????
// Temporary - Should be removed when read commited from unaudited table is implemented
CommitTransaction();
TESTPOINT2(CRUGlobals::TESTPOINT105, GetRootMVName());
SetState(EX_EPILOGUE);
}
示例7: TESTPOINT2
void CRUUnAuditRefreshTaskExecutor::Prologue()
{
TESTPOINT2(CRUGlobals::TESTPOINT101, GetRootMVName());
BeginTransaction();
if (CDDObject::eON_STATEMENT == GetRootMVType())
{
PrologueHandleOnStatementMV();
}
// Set the MV non-available etc ...
SetObjectsUnavailable();
CommitTransaction();
TESTPOINT2(CRUGlobals::TESTPOINT102, GetRootMVName());
if (TRUE == isPurgedata_)
{
SetState(EX_PURGE_DATA);
}
else if (TRUE == IsRecompute())
{
SetState(EX_RECOMPUTE);
}
else
{
SetState(EX_REFRESH);
}
}
示例8: while
void CRULogCleanupTaskExecutor::CleanLogFirstN(SQL_STATEMENT statement)
{
// Compilation Stage
CDMPreparedStatement *pStat =
logCleanupTEDynamicContainer_.GetPreparedStatement(statement);
while (TRUE)
{
BeginTransaction();
ExecuteStatement(*pStat,
IDS_RU_LOG_CLEANUP_FAILED,
NULL, /* error argument */
TRUE /* Obtain row count */);
CommitTransaction();
TESTPOINT(CRUGlobals::TESTPOINT160);
if (pStat->GetRowsAffected() <
CRULogCleanupSQLComposer::MAX_ROW_TO_DELETE_IN_SINGLE_TXN)
{
break;
}
}
}
示例9: RUASSERT
void CRUTableSyncTaskExecutor::Epilogue()
{
CRUTableSyncTask *pParentTask = (CRUTableSyncTask *)GetParentTask();
RUASSERT(NULL != pParentTask);
CRUTbl &tbl = pParentTask->GetTable();
if (TRUE == tbl.IsIncEpochNeeded())
{
if (TRUE == tbl.IsLongLockNeeded())
{
BeginTransaction();
tbl.ExecuteReadProtectedOpen();
CommitTransaction();
}
if (TRUE == tbl.IsLogRPOpenPending())
{
// The above condition is false only in case of
// a non involved incremental mv.We do not need to lock the logs
// because we rely on the ddl locks
tbl.ReleaseLogReadProtectedOpen();
}
}
SetState(EX_COMPLETE);
}
示例10: RUASSERT
void CRUAuditRefreshTaskExecutor::Prologue()
{
RUASSERT(FALSE == IsTransactionOpen());
BeginTransaction();
if (CDDObject::eON_STATEMENT == GetRootMVType())
{
PrologueHandleOnStatementMV();
}
SetObjectsUnavailable();
CommitTransaction();
TESTPOINT2(CRUGlobals::TESTPOINT102, GetRootMVName());
if (TRUE == isPurgedata_)
{
// purgedata is done in main process
SetState(EX_PURGE_DATA);
}
else
{
// refresh, recompute, and popindex done in remote process
SetState(EX_REMOTE_START);
}
}
示例11: EndTransactionInternal
void
ClientLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
void* aCallbackData,
EndTransactionFlags aFlags)
{
if (!mForwarder->IPCOpen()) {
mInTransaction = false;
return;
}
if (mWidget) {
mWidget->PrepareWindowEffects();
}
EndTransactionInternal(aCallback, aCallbackData, aFlags);
ForwardTransaction(!(aFlags & END_NO_REMOTE_COMPOSITE));
if (mRepeatTransaction) {
mRepeatTransaction = false;
mIsRepeatTransaction = true;
if (BeginTransaction()) {
ClientLayerManager::EndTransaction(aCallback, aCallbackData, aFlags);
}
mIsRepeatTransaction = false;
} else {
MakeSnapshotIfRequired();
}
mInTransaction = false;
mTransactionStart = TimeStamp();
}
示例12: EndTransactionInternal
void
ClientLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
void* aCallbackData,
EndTransactionFlags aFlags)
{
if (mWidget) {
mWidget->PrepareWindowEffects();
}
EndTransactionInternal(aCallback, aCallbackData, aFlags);
ForwardTransaction(!(aFlags & END_NO_REMOTE_COMPOSITE));
if (mRepeatTransaction) {
mRepeatTransaction = false;
mIsRepeatTransaction = true;
BeginTransaction();
ClientLayerManager::EndTransaction(aCallback, aCallbackData, aFlags);
mIsRepeatTransaction = false;
} else {
MakeSnapshotIfRequired();
}
for (size_t i = 0; i < mTexturePools.Length(); i++) {
mTexturePools[i]->ReturnDeferredClients();
}
mInTransaction = false;
mTransactionStart = TimeStamp();
}
示例13: WillBeginBatchNotify
NS_IMETHODIMP
nsTransactionManager::BeginBatch()
{
nsresult result;
// We can batch independent transactions together by simply pushing
// a dummy transaction item on the do stack. This dummy transaction item
// will be popped off the do stack, and then pushed on the undo stack
// in EndBatch().
bool doInterrupt = false;
result = WillBeginBatchNotify(&doInterrupt);
if (NS_FAILED(result)) {
return result;
}
if (doInterrupt) {
return NS_OK;
}
result = BeginTransaction(0);
nsresult result2 = DidBeginBatchNotify(result);
if (NS_SUCCEEDED(result))
result = result2;
return result;
}
示例14: NS_ENSURE_TRUE
NS_IMETHODIMP
nsTransactionManager::DoTransaction(nsITransaction *aTransaction)
{
nsresult result;
NS_ENSURE_TRUE(aTransaction, NS_ERROR_NULL_POINTER);
bool doInterrupt = false;
result = WillDoNotify(aTransaction, &doInterrupt);
if (NS_FAILED(result)) {
return result;
}
if (doInterrupt) {
return NS_OK;
}
result = BeginTransaction(aTransaction);
if (NS_FAILED(result)) {
DidDoNotify(aTransaction, result);
return result;
}
result = EndTransaction();
nsresult result2 = DidDoNotify(aTransaction, result);
if (NS_SUCCEEDED(result))
result = result2;
return result;
}
示例15: fsal_posixdb_delete
fsal_posixdb_status_t fsal_posixdb_delete(fsal_posixdb_conn * p_conn, /* IN */
posixfsal_handle_t * p_parent_directory_handle, /* IN */
fsal_name_t * p_filename, /* IN */
fsal_posixdb_fileinfo_t *
p_object_info /* IN */ )
{
result_handle_t res;
fsal_posixdb_status_t st;
char query[2048];
/*******************
* 1/ sanity check *
*******************/
if(!p_conn || !p_parent_directory_handle || !p_filename)
ReturnCodeDB(ERR_FSAL_POSIXDB_FAULT, 0);
BeginTransaction(p_conn);
/*******************************
* 2/ we check the file exists *
*******************************/
snprintf(query, 2048, "SELECT Parent.handleid, Parent.handlets, "
"Handle.deviceid, Handle.inode, Handle.nlink, Handle.ctime, Handle.ftype "
"FROM Parent INNER JOIN Handle ON Parent.handleid = Handle.handleid "
"AND Parent.handlets=Handle.handlets "
"WHERE handleidparent=%llu AND handletsparent=%u AND name='%s' "
"FOR UPDATE", p_parent_directory_handle->data.id,
p_parent_directory_handle->data.ts, p_filename->name);
st = db_exec_sql(p_conn, query, &res);
if(FSAL_POSIXDB_IS_ERROR(st))
goto rollback;
if(mysql_num_rows(res) != 1)
{
/* parent entry not found */
mysql_free_result(res);
RollbackTransaction(p_conn);
ReturnCodeDB(ERR_FSAL_POSIXDB_NOENT, 0);
}
mysql_free_result(res);
/***********************************************
* 3/ Get information about the file to delete *
***********************************************/
st = fsal_posixdb_internal_delete(p_conn, p_parent_directory_handle->data.id,
p_parent_directory_handle->data.ts,
p_filename->name, p_object_info);
if(FSAL_POSIXDB_IS_ERROR(st))
goto rollback;
return EndTransaction(p_conn);
rollback:
RollbackTransaction(p_conn);
return st;
}