void CliGlobals::setUdrSQLAccessMode(Lng32 mode) { currContext()->setUdrSQLAccessMode(mode); }
ExEspManager *CliGlobals::getEspManager() { return currContext()->getEspManager(); }
void CliGlobals::setUdrErrorChecksEnabled(NABoolean b) { currContext()->setUdrErrorChecksEnabled(b); }
void CliGlobals::setJniErrorStr(const char *errorStr) { currContext()->setJniErrorStr(errorStr); }
const char* CliGlobals::getJniErrorStrPtr() { return currContext()->getJniErrorStrPtr(); }
void CliGlobals::setUdrXactAborted(Int64 currTransId, NABoolean b) { currContext()->setUdrXactAborted(currTransId, b); }
NABoolean CliGlobals::sqlAccessAllowed() { return currContext()->sqlAccessAllowed(); }
NAHeap *CliGlobals::getCurrContextHeap() { return currContext()->exHeap(); }
ExUdrServerManager *CliGlobals::getUdrServerManager() { return currContext()->getUdrServerManager(); }
ExSqlComp * CliGlobals::getArkcmp(short index) { //return sharedArkcmp_; return currContext()->getArkcmp(index); }
Lng32 CliGlobals::setEnvVar(const char * name, const char * value, NABoolean reset) { if ((! name) || (! value) || (isESPProcess_)) return 0; NABoolean found = FALSE; Lng32 envvarPos = -1; if (ComRtGetEnvValueFromEnvvars((const char**)envvars_, name, &envvarPos)) found = TRUE; if ((NOT found) && (reset)) return 0; Int32 nEnvs = 0; if (envvars_) { for (nEnvs=0; envvars_[nEnvs]; nEnvs++); } if (reset) { // nEnvs--; } else if (NOT found) { envvarPos = nEnvs; nEnvs++; } // one extra entry, if envvar not found. // one extra to null terminate envvar list. // long envvarsLen = (nEnvs + (NOT found ? 1 : 0) + 1) * sizeof(char*); Lng32 newEnvvarsLen = (nEnvs + 1) * sizeof(char*); Int32 count; for (count=0; count < nEnvs; count++) { if (count == envvarPos) // if ((found) && (count == envvarPos)) { if (NOT reset) newEnvvarsLen += strlen(name) + strlen("=") + strlen(value) + 1; } else newEnvvarsLen += str_len(envvars_[count])+1; } /* if (NOT found) { nEnvs++; newEnvvarsLen += strlen(name) + strlen("=") + strlen(value) + 1; } */ // allocate contiguous space for envvars char ** newEnvvars = (char**)(new(ipcHeap_) char[newEnvvarsLen]); char * newEnvvarsValue = (char*)(newEnvvars + ((reset ? (nEnvs-1) : nEnvs) + 1)); // and copy envvars_ to newEnvvars Int32 tgtCount = 0; for (count=0; count < nEnvs; count++) { newEnvvars[tgtCount] = newEnvvarsValue; Lng32 l = 0; if (count == envvarPos) { if (NOT reset) { strcpy(newEnvvarsValue, name); strcat(newEnvvarsValue, "="); strcat(newEnvvarsValue, value); l = strlen(name) + strlen("=") + strlen(value) + 1; tgtCount++; } } else { l = str_len(envvars_[count])+1; str_cpy_all(newEnvvarsValue, envvars_[count], l); tgtCount++; } newEnvvarsValue = newEnvvarsValue + l; } if (reset) { nEnvs--; } newEnvvars[nEnvs] = 0; if (envvars_) { // deallocate the current set of envvars ipcHeap_->deallocateMemory(envvars_); envvars_ = NULL; } envvars_ = newEnvvars; // set or reset this envvar in SessionDefaults. SessionEnvvar * se = new(ipcHeap_) SessionEnvvar(ipcHeap_, (char*)name, (char*)value); // remove if an entry exists currContext()->getSessionDefaults()->sessionEnvvars()->remove(*se); // insert a new entry, if this is not a RESET operation. if (NOT reset) { currContext()->getSessionDefaults()->sessionEnvvars()->insert(*se); } delete se; // also set it in IpcEnvironment so it could be used to send // it to mxcmp. getEnvironment()->setEnvVars(envvars_); getEnvironment()->setEnvVarsLen(newEnvvarsLen); envvarsContext_++; #ifdef NA_CMPDLL // need to set the env to the embedded compiler too if (currContext()->isEmbeddedArkcmpInitialized()) { currContext()->getEmbeddedArkcmpContext() ->setArkcmpEnvDirect(name, value, reset); } #endif // NA_CMPDLL return sendEnvironToMxcmp(); }
ExeTraceInfo *CliGlobals::getExeTraceInfo() { return currContext()->getExeTraceInfo(); }
IpcServerClass *CliGlobals::getCbServerClass() { return currContext()->getCbServerClass(); }
ExSsmpManager *CliGlobals::getSsmpManager() { return currContext()->getSsmpManager(); }
void CliGlobals::setUdrAccessModeViolation(NABoolean b) { currContext()->setUdrAccessModeViolation(b); }
NABoolean CliGlobals::getUdrErrorChecksEnabled() { return currContext()->getUdrErrorChecksEnabled(); }
void CliGlobals::setUdrXactViolation(NABoolean b) { currContext()->setUdrXactViolation(b); }
Lng32 CliGlobals::getUdrSQLAccessMode() { return currContext()->getUdrSQLAccessMode(); }
void CliGlobals::clearUdrErrorFlags() { currContext()->clearUdrErrorFlags(); }
NABoolean CliGlobals::getUdrAccessModeViolation() { return currContext()->getUdrAccessModeViolation(); }
void CliGlobals::setJniErrorStr(NAString errorStr) { currContext()->setJniErrorStr(errorStr); }
NABoolean CliGlobals::getUdrXactViolation() { return currContext()->getUdrXactViolation(); }
NAString CliGlobals::getJniErrorStr() { return currContext()->getJniErrorStr(); }
NABoolean CliGlobals::getUdrXactAborted() { return currContext()->getUdrXactAborted(); }
void CliGlobals::updateTransMode(TransMode *transMode) { currContext()->getTransaction()->getTransMode()-> updateTransMode(transMode); }
NAHeap *CliGlobals::getIpcHeap() { return currContext()->getIpcHeap(); }