コード例 #1
0
void CliGlobals::setUdrSQLAccessMode(Lng32 mode) 
{ currContext()->setUdrSQLAccessMode(mode); }
コード例 #2
0
ExEspManager *CliGlobals::getEspManager()
{
  return currContext()->getEspManager();
}
コード例 #3
0
void CliGlobals::setUdrErrorChecksEnabled(NABoolean b) 
{ currContext()->setUdrErrorChecksEnabled(b); }
コード例 #4
0
void CliGlobals::setJniErrorStr(const char *errorStr)
{
   currContext()->setJniErrorStr(errorStr);
}
コード例 #5
0
const char* CliGlobals::getJniErrorStrPtr()
{
  return currContext()->getJniErrorStrPtr();
}
コード例 #6
0
void CliGlobals::setUdrXactAborted(Int64 currTransId, NABoolean b)
{ currContext()->setUdrXactAborted(currTransId, b); }
コード例 #7
0
NABoolean CliGlobals::sqlAccessAllowed() 
{ return currContext()->sqlAccessAllowed(); }
コード例 #8
0
NAHeap *CliGlobals::getCurrContextHeap()
{
   return currContext()->exHeap();
}
コード例 #9
0
ExUdrServerManager *CliGlobals::getUdrServerManager()
{ return currContext()->getUdrServerManager(); }
コード例 #10
0
ExSqlComp * CliGlobals::getArkcmp(short index)
{
  //return sharedArkcmp_;
  return currContext()->getArkcmp(index);
}
コード例 #11
0
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();
}
コード例 #12
0
ExeTraceInfo *CliGlobals::getExeTraceInfo()
{
  return currContext()->getExeTraceInfo();
}
コード例 #13
0
IpcServerClass *CliGlobals::getCbServerClass()
{
  return currContext()->getCbServerClass();
}
コード例 #14
0
ExSsmpManager *CliGlobals::getSsmpManager()
{
  return currContext()->getSsmpManager();
}
コード例 #15
0
void CliGlobals::setUdrAccessModeViolation(NABoolean b) 
{ currContext()->setUdrAccessModeViolation(b); }
コード例 #16
0
NABoolean CliGlobals::getUdrErrorChecksEnabled() 
{ return currContext()->getUdrErrorChecksEnabled(); }
コード例 #17
0
void CliGlobals::setUdrXactViolation(NABoolean b)
{ currContext()->setUdrXactViolation(b); }
コード例 #18
0
Lng32 CliGlobals::getUdrSQLAccessMode() 
{ return currContext()->getUdrSQLAccessMode(); }
コード例 #19
0
void CliGlobals::clearUdrErrorFlags()
{ currContext()->clearUdrErrorFlags(); }
コード例 #20
0
NABoolean CliGlobals::getUdrAccessModeViolation() 
{ return currContext()->getUdrAccessModeViolation(); }
コード例 #21
0
void CliGlobals::setJniErrorStr(NAString errorStr)
{
   currContext()->setJniErrorStr(errorStr);
}
コード例 #22
0
NABoolean CliGlobals::getUdrXactViolation() 
{ return currContext()->getUdrXactViolation(); }
コード例 #23
0
NAString CliGlobals::getJniErrorStr()
{
  return currContext()->getJniErrorStr();
}
コード例 #24
0
NABoolean CliGlobals::getUdrXactAborted() 
{ return currContext()->getUdrXactAborted(); }
コード例 #25
0
void CliGlobals::updateTransMode(TransMode *transMode)
{
  currContext()->getTransaction()->getTransMode()->
           updateTransMode(transMode);
}
コード例 #26
0
NAHeap *CliGlobals::getIpcHeap()
{
   return currContext()->getIpcHeap();
}