[Iscs-developers] ISCS/devel-docs/Functions/CommitChanges CommitChanges.html,1.29,1.30
Status: Beta
Brought to you by:
jsulliva
From: <jsu...@us...> - 2003-08-28 03:37:39
|
Update of /cvsroot/iscs/ISCS/devel-docs/Functions/CommitChanges In directory sc8-pr-cvs1:/tmp/cvs-serv12008/devel-docs/Functions/CommitChanges Modified Files: CommitChanges.html Log Message: Commit changes from a remote SPM now works Index: CommitChanges.html =================================================================== RCS file: /cvsroot/iscs/ISCS/devel-docs/Functions/CommitChanges/CommitChanges.html,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** CommitChanges.html 26 Aug 2003 02:47:17 -0000 1.29 --- CommitChanges.html 28 Aug 2003 03:37:06 -0000 1.30 *************** *** 7,11 **** <META NAME="CREATED" CONTENT="20021220;11004400"> <META NAME="CHANGEDBY" CONTENT="John Sullivan"> ! <META NAME="CHANGED" CONTENT="20030825;21192300"> <STYLE> <!-- --- 7,11 ---- <META NAME="CREATED" CONTENT="20021220;11004400"> <META NAME="CHANGEDBY" CONTENT="John Sullivan"> ! <META NAME="CHANGED" CONTENT="20030827;14111900"> <STYLE> <!-- *************** *** 226,243 **** <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> We create a lock on the update process by setting the contents of the ! updateInProcess file on the database server to "1". We ! then set the OwnLock boolean variable on the SPM to true. ! Originally, we relied upon the contents of the updateInProcess file ! to determine if we had a lock but then realized that the lock could ! be set by a different station. Thus, if one user opened an SPM and ! tried to close it while another user had a lock on an update, the ! user who had made no updates would receive an error message that they ! could not log out because an update was in progress even though it ! was not their update. Thus, we will use the updateInProcess file to ! check to see if we can lock the update process and then use it to ! obtain the lock, we will check the SPM's variable OwnLock to see if ! the SPM owns a lock and is thus not allowed to exit until the lock is ! released.<B> - DONE - John Sullivan August 25, 2003</B><SPAN STYLE="font-weight: medium"> ! </SPAN> </P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> --- 226,242 ---- <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> We create a lock on the update process by setting the contents of the ! updateInProcess file on the database server to "1". We then ! set the OwnLock boolean variable on the SPM to true. Originally, we ! relied upon the contents of the updateInProcess file to determine if ! we had a lock but then realized that the lock could be set by a ! different station. Thus, if one user opened an SPM and tried to close ! it while another user had a lock on an update, the user who had made ! no updates would receive an error message that they could not log out ! because an update was in progress even though it was not their ! update. Thus, we will use the updateInProcess file to check to see if ! we can lock the update process and then use it to obtain the lock, we ! will check the SPM's variable OwnLock to see if the SPM owns a lock ! and is thus not allowed to exit until the lock is released.<B> - DONE ! - John Sullivan August 25, 2003</B> </P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> *************** *** 617,623 **** updated. We do this rather than use the database cursor because it enables us to use the same commit function to process the list of ! retries after failures so we do:</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! void SPMMainForm::prepPEPUpdateSList() <B>- DONE - John Sullivan - August 11, 2003</B> </P> --- 616,624 ---- updated. We do this rather than use the database cursor because it enables us to use the same commit function to process the list of ! retries after failures. It also allows us to use a shortened list if ! there are no "ALL&" entries lest we iterate the entire ! PEP table for an update to a limited number of PEPs so we do:</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! bool SPMMainForm::prepPEPUpdateSList() <B>- DONE - John Sullivan - August 11, 2003</B> </P> *************** *** 625,640 **** {</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! <A HREF="../../SPMNVObjects.html#PEPUpdateSList">PEPUpdateSList</A>->clear();</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> so->SQProd->setForwardOnly(true); // reduces memory consumption</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> so-><A HREF="../../SPMNVObjects.html#SQProd">SQProd</A>->exec("select ! pep_name from pep"); -- CATCH ERROR</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> while (so->SQProd->next()) {</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! PEPUpdateSList->append(so->SQProd->value(0).toString());</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> }</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> }</P> --- 626,735 ---- {</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! so->PEPUpdateSList.clear();</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! // We cycle through all of the lists to build so-><A HREF="../../SPMNVObjects.html#PEPUpdateSList">PEPUpdateSList</A> ! from the individual PEPs which have changed unless we encounter a ! change that applies to ALL PEPs in which case we then build the full ! PEPUpdateSList. We start with FWChanges because it is the most ! likely to contain an ALL& entry.</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! if ( needAllPEPs(so->FWChanges) || needAllPEPs(so->DNSChanges) ! || needAllPEPs(so->NTPChanges) ) {</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! if ( ! prepFullPEPUpdateSList() ) {</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! return false;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! return true;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! <BR> ! </P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! bool SPMMainForm::needAllPEPs(const QStringList SList)</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! {</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! QString PEP;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! QStringList::Iterator it;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! QStringList::Iterator Pit;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! bool match = false;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! for (it = so->SList.begin(); it != so->SList.end(); it++ ) { ! </P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! if ( (*it).left(4) == "ALL&" ) {</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! return true;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! else { // extract the PEP name and add it to PEPUpdateSList if it ! does not already exist</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! PEP = (*it).left((*it).find("&"));</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! for (Pit = so->PEPUpdateSList.begin(); Pit != ! so->PEPUpdateSList.end(); Pit++ ) {</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! if ( *Pit == PEP ) { //i.e., the PEP is already in the list</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! match = true;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! break;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! else {</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! match = false;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! if ( ! match ) {</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! so->PEPUpdateSList.append(PEP);</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! return false;</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! }</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! <BR> ! </P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! bool SPMMainForm::prepFullPEPUpdateSList()</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! {</P> ! <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! <SPAN LANG="en-US">so-></SPAN><A HREF="../../SPMNVObjects.html#PEPUpdateSList">PEPUpdateSList</A>->clear();</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> so->SQProd->setForwardOnly(true); // reduces memory consumption</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> so-><A HREF="../../SPMNVObjects.html#SQProd">SQProd</A>->exec("select ! pep_name from pep"); -- CATCH ERROR - return false</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> while (so->SQProd->next()) {</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> ! so->PEPUpdateSList.append(so->SQProd->value(0).toString());</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> }</P> + <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> + return true;</P> <P LANG="en-US" CLASS="western" ALIGN=LEFT STYLE="margin-bottom: 0in"> }</P> |