>I would like my functions and procedures to have private datasessions. Three reasons:
>
>- function/procedure calls will not change the state of tables
>- makes it explict which tables a function/procedure uses
>- automatically closes all temporary cursors
>
>Can anyone point to towards some resources on how to do this? Any the cons to this idea?
Hey Evan,
DEFINE CLASS Process AS SESSION
PROCEDURE UpdateStatus
LPARAMETER tnNewStatus,tdWeekend,tcUserid
USE DATA\pay_tran SHARED IN 0
SELECT pay_tran
*-- Process data here...
USE IN pay_tran
ENDPROC
ENDDEFINE
The Session class is the ticket. By default it creates it's own data session.
loUpdate = CREATEOBJECT("Process")
loUpdate.UpdateStatus(3,THIS.dWeekend,THISFORM.oApp.cCurrentUser)
RELEASE loUpdate
Bill