Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very slow after run a period of time
Message
From
13/08/2001 22:30:38
 
 
To
13/08/2001 22:12:39
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00542658
Message ID:
00543341
Views:
18
Hi,

>>For instance, are they long or short in duration?
Short
>>Do you use embedded transactions? (i.e. transactions within transactions)
No
>>Are you sure that you TABLEUPDATE all tables correctly at all times?
During testing, YES

Here is my part of source code
Select tmpCheck
Scan
   tmpStockLevel = tmpCheck.qty &&Qty Sold
   tmpCurAmt = tmpCheck.ttlCost

   Select tmpStockInfo
   Locate FOR alltrim(upper(ino)) == alltrim(upper(tmpCheck.ino));
	AND ALLTRIM(upper(bcode)) == ALLTRIM(upper(tmpCheck.iBarcode)) and ;
	alltrim(upper(locCode)) == posLocation
   If found()
     Do case
        Case alltrim(upper(tmpCheck.itemType)) = "N" 
  	  **Insert record into tmpSalesDetails 
       	    Replace qty with qty - tmpCheck.qty
        Case alltrim(upper(tmpCheck.itemType)) = "PKG"
	   Thisform.updateRepacking()
        Case alltrim(upper(tmpCheck.itemType)) = "LP"
   	  **Insert record into tmpSalesDetails 
     	    Replace qty with qty - tmpCheck.qty
     Endcase
   Else && Item Not Found in Stock_Status
     do case
	case alltrim(upper(tmpCheck.itemType)) = "N" 
    	  **Insert record into tmpSalesDetails 
        Case alltrim(upper(tmpCheck.itemType)) = "PKG" 
          Thisform.upRepackUnknow()
	Case alltrim(upper(tmpCheck.itemType)) = "LP"
          **Insert record into tmpSalesDetails 
 
	Endcase
   Endif
Endscan

With THISFORM
  Do CASE
    Case .c3.combo1.VALUE = "Member"
        tmpsType = alltrim(upper(.combo2.VALUE))
	tmpIdNo = ALLTRIM(.c3.text2.VALUE)
	tmpSalesTo = .c3.combo1.VALUE
    Otherwise
	tmpIdNo = ""
	tmpsType = alltrim(upper(.combo2.VALUE))
	tmpSalesTo = .c3.combo1.VALUE
	tmpCustName = alltrim(.c3.text4.value)
  Endcase

  tmpSno = alltrim(upper(.lblsID.CAPTION))
  tmpsDate = date()
  tmpsLocation = .lblsLocation.CAPTION
  tmpsFrom = alltrim(upper(.lblsFrom.CAPTION))
  typeSales = "SALES"
  Select SUM(ttlCost) AS ttlBonus FROM tmpCheck INTO CURSOR tmpBonus
  tmpTtlCost = tmpBonus.ttlBonus
   **Insert record into tmpSales 
Endwith

If THISFORM.c3.combo1.VALUE = "Member"
  Select tmpmemberInfo
  Locate for alltrim(card_no) == alltrim(THISFORM.c3.text2.VALUE)
  If found()
     Replace bonus with ALLTRIM(STR(VAL(bonus) + (FLOOR(tmpTtlCost)))) ,;
	acc_balance with acc_balance + tmpTtlCost
  Endif
Endif

llRollBack = .F.
Begin TRANSACTION

If noType = "y"
  If NOT llRollBack AND NOT TABLEUPDATE(.T.,.F., 89)
	llRollBack = .T.
  Endif
Endif

If NOT llRollBack AND NOT TABLEUPDATE(.T.,.F., 1)
  llRollBack = .T.
Endif

If THISFORM.c3.combo1.VALUE = "Member"
  If NOT llRollBack AND NOT TABLEUPDATE(.T.,.F., 2)
	llRollBack = .T.
  Endif
Endif

If NOT llRollBack AND NOT TABLEUPDATE(.T.,.F., 3)
  llRollBack = .T.
Endif

If NOT llRollBack AND NOT TABLEUPDATE(.T.,.F., 4)
  llRollBack = .T.
Endif

If NOT llRollBack AND NOT TABLEUPDATE(.T.,.F., 5)
  llRollBack = .T.
Endif

If llRollBack
  Aerror(tmpErrorArray)
  Rollback
  If noType = "y"
    Tablerevert(.T.,"tmpRunningNo")
  Endif
  Tablerevert(.T.,"tmpStockInfo")
  If THISFORM.c3.combo1.VALUE = "Member"
    Tablerevert(.T.,"tmpMemberInfo")
  Endif
    Tablerevert(.T.,"tmpSales")
    Tablerevert(.T.,"tmpSalesDetails")
    tablerevert(.T.,"tmpHisRunOut")
    logWrite("User ID : " + upper(loginID) + " - Error Found In Adding Sales.")
    If AERROR(tmpErrorArray) >= 1
	Messagebox (ALLTRIM(STR(tmpErrorArray[1])) + " " + tmpErrorArray[2] + ;
	" Please try again later.",0+48,thisform.msgName)
    Endif
  Return
Else
  End TRANSACTION
  flush
endif
Thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform