Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error being raised With COM+
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00528556
Message ID:
00529676
Views:
10
However, for a stateless COM application like a web app (vfp mtdll), ALWAYS use ComReturnError. This is a good rule-of-thumb for web apps.
>In addition to my previous reply, i just look at your code and remembered of another rule you should follow:
>
>- NEVER use ComReturnError() Using it will cause your component to stop executing and return the control to the client, again bypassing any Garbage collection method you may have. Since you never know where an error occurs in the code, it would also be impossible to predict the effect of stopping code execution.
>
>The following is my GC methods
>
>
>	PROTECTED FUNCTION CollectGarbage()
>	*----------------------------------
>		
>		LOCAL ARRAY laMembers(1)
>		LOCAL loObj, lcObj
>
>		This.CollectingGarbage = .T.	
>
>		=AMEMBERS( laMembers, THIS )
>		FOR i = 1 TO ALEN( laMembers )
>			IF Type( 'Eval("This." + lamembers(i) )' ) == "O"
>				lcObj = "This." + lamembers(i)
>				*-- If it's a recordset Close it before nulling it
>				IF Type( 'Eval("This." + lamembers(i) + "Status"  )') == 'N' AND Eval("This." + lamembers(i) + "Status"  ) = adStateOpen
>					&lcObj..Close
>				ENDIF
>				&lcObj = NULL
>			ENDIF
>		ENDFOR
>
>		IF Application.StartMode = 5 OR Application.StartMode = 3
>			Close Tables All
>			CLEAR DLLS
>		ENDIF
>
>		This.CollectingGarbage = .F. 		
>
>	ENDFUNC
>
>	PROTECTED FUNCTION Destroy()
>		IF !THIS.lGarbageCollected
>			THIS.CollectGarbage()
>		ENDIF
>        ENDFUNC
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform