short SeqGenEntry::fetchNewRange(SequenceGeneratorAttributes &inSGA) { Lng32 cliRC = 0; // fetch new range from Seq Generator database SequenceGeneratorAttributes sga; sga = inSGA; if (sga.getSGCache() == 0) sga.setSGCache(1); sga.setSGRetryNum(getRetryNum()); cliRC = SQL_EXEC_SeqGenCliInterface(&cliInterfaceArr_, &sga); if (cliRC < 0) return (short)cliRC; cachedStartValue_ = sga.getSGNextValue(); cachedCurrValue_ = cachedStartValue_; cachedEndValue_ = sga.getSGEndValue(); if (cachedStartValue_ > sga.getSGMaxValue()) { return -1579; // max reached } fetchNewRange_ = FALSE; return 0; }
short ElemDDLSGOptions::genSGA(SequenceGeneratorAttributes &sga) { sga.setSGStartValue(getStartValue()); sga.setSGIncrement(getIncrement()); sga.setSGMinValue(getMinValue()); sga.setSGMaxValue(getMaxValue()); sga.setSGCache(getCache()); sga.setSGCycleOption(isCycle()); sga.setSGFSDataType(getFSDataType()); sga.setSGResetOption(isReset()); return 0; }