本文整理汇总了C++中Owned::commit方法的典型用法代码示例。如果您正苦于以下问题:C++ Owned::commit方法的具体用法?C++ Owned::commit怎么用?C++ Owned::commit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Owned
的用法示例。
在下文中一共展示了Owned::commit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeStringException
IPropertyTree *getPkgSetRegistry(const char *process, bool readonly)
{
Owned<IRemoteConnection> globalLock = querySDS().connect("/PackageSets/", myProcessSession(), RTM_LOCK_WRITE|RTM_CREATE_QUERY, SDS_LOCK_TIMEOUT);
if (!globalLock)
throw MakeStringException(PKG_DALI_LOOKUP_ERROR, "Unable to connect to PackageSet information in dali /PackageSets");
IPropertyTree *pkgSets = globalLock->queryRoot();
if (!pkgSets)
throw MakeStringException(PKG_DALI_LOOKUP_ERROR, "Unable to open PackageSet information in dali /PackageSets");
if (!process || !*process)
process = "*";
StringBuffer id;
buildPkgSetId(id, process);
//Only lock the branch for the target we're interested in.
VStringBuffer xpath("/PackageSets/PackageSet[@id='%s']", id.str());
Owned<IRemoteConnection> conn = querySDS().connect(xpath.str(), myProcessSession(), readonly ? RTM_LOCK_READ : RTM_LOCK_WRITE, SDS_LOCK_TIMEOUT);
if (!conn)
{
if (readonly)
return NULL;
Owned<IPropertyTree> pkgSet = createPTree();
pkgSet->setProp("@id", id.str());
pkgSet->setProp("@process", process);
pkgSets->addPropTree("PackageSet", pkgSet.getClear());
globalLock->commit();
conn.setown(querySDS().connect(xpath.str(), myProcessSession(), RTM_LOCK_WRITE, SDS_LOCK_TIMEOUT));
}
return (conn) ? conn->getRoot() : NULL;
}
示例2: WuResubmit
bool WuResubmit(const char *wuid)
{
Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
Owned<IWorkUnit> wu = factory->updateWorkUnit(wuid);
if (!wu)
{
ERRLOG("WuResubmit(%s): could not find workunit",wuid);
return false;
}
if (wu->getState()!=WUStateFailed)
{
ERRLOG("WuResubmit(%s): could not resubmit as workunit state is '%s'", wuid, wu->queryStateDesc());
return false;
}
SCMStringBuffer token;
wu->getSecurityToken(token);
SCMStringBuffer user;
SCMStringBuffer password;
extractToken(token.str(), wuid, user, password);
wu->resetWorkflow();
wu->setState(WUStateSubmitted);
wu->commit();
wu.clear();
submitWorkUnit(wuid,user.str(),password.str());
PROGLOG("WuResubmit(%s): resubmitted",wuid);
return true;
}
示例3: cleanupWorkUnitSchedule
void cleanupWorkUnitSchedule()
{
Owned<IRemoteConnection> conn = querySDS().connect("/Schedule", myProcessSession(), RTM_LOCK_WRITE, connectionTimeout);
if(!conn) return;
Owned<IPropertyTree> root(conn->queryRoot()->getBranch("."));
recursiveCleanup(root, 2);
conn->commit();
cleanupSchedulerList(root);
}
示例4: CXRefNode
IXRefNode * CXRefNodeManager::CreateXRefNode(const char* NodeName)
{
Owned<IRemoteConnection> conn = querySDS().connect("/DFU/XREF",myProcessSession(),RTM_CREATE_QUERY|RTM_LOCK_WRITE ,INFINITE);
IPropertyTree* xref_ptree = conn->queryRoot();
IPropertyTree* cluster_ptree = xref_ptree->addPropTree("Cluster", createPTree());
cluster_ptree->setProp("@name",NodeName);
conn->commit();
conn->changeMode(RTM_NONE);
return new CXRefNode(NodeName,conn);
}
示例5: executeWorkunit
int CEclAgentExecutionServer::executeWorkunit(const char * wuid)
{
//build eclagent command line
StringBuffer command;
#ifdef _WIN32
command.append(".\\eclagent.exe");
#else
command.append("start_eclagent");
#endif
StringBuffer cmdLine = command;
cmdLine.append(" WUID=").append(wuid).append(" DALISERVERS=").append(daliServers);
DWORD runcode;
PROGLOG("AgentExec: Executing '%s'", cmdLine.str());
#ifdef _WIN32
bool success = invoke_program(cmdLine.str(), runcode, false, NULL, NULL);
#else
//specify "wait" to eliminate linux zombies. Waits for the startup script to
//complete (not eclagent), because script starts eclagent in the background
bool success = invoke_program(cmdLine.str(), runcode, true, NULL, NULL);
#endif
if (success)
{
if (runcode != 0)
PROGLOG("Process failed during execution: %s error(%"I64F"i)", cmdLine.str(), (unsigned __int64) runcode);
else
PROGLOG("Execution started");
}
else
{
Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
Owned<IWorkUnit> workunit = factory->updateWorkUnit(wuid);
if (workunit)
{
workunit->setState(WUStateFailed);
workunit->commit();
}
PROGLOG("Process failed to start: %s", cmdLine.str());
}
return success && runcode == 0;
}