Alaska Software Inc. - Lost cargo
Username: Password:
AuthorTopic: Lost cargo
Allen Lee Lost cargo
on Tue, 15 Jun 2010 14:02:20 -0700
Hi All:
Has anyone had session parameters dropped between screens?

Scenerio example:
    Call oContext:setCargo() and store an 8 element array on first page.
    Call oContext:getCargo() on 5 subsequent pages
    Occasionally, a user will find the array undefined (not retrieved)

The oContext:getCargo() could be successful on 4 pages and fail on the 
fifth  ... OR fail on the third page.

We know that it is not a programming issue because the same user could 
logout and try again later and everything works.
I cannot reproduce this problem.

Web server stats:
    Max Service Time: 15.64
    Avg Service Time: 0.14
    Worker Threads: 12
    Workload Peak: 2

Would setting WAA_TRACE (off) or WAA_INTERNAL_LOG (off) to ON provide 
any clues?

Could the issue by related to slow response time of the user's network?
Jack Duijf Re: Lost cargo
on Wed, 16 Jun 2010 19:54:47 +0200
Hello,

Try to log all your SetCargo() and GetCargo()
See code below.
This wil exactly tell you when and how often the Getcargo() and 
SetCargo() is called in wich thread.
You can add any other requirerd info in ::AddToLog()

Change oContact := oldcontext():New()
To oContect := Log_Context():New()

Hope this helps.

Regards,
Jack Duijf



CLASS Log_Context FROM  oldcontext
HIDDEN:
VAR cLogFile
METHOD AddToLog
EXPORTED:
METHOD Init
METHOD Destroy
METHOD SetCargo
METHOD GetCargo
ENDCLASS

METHOD Log_Context:Init(p1,p2,p3,p4)
::oldcontext:Init(p1,p2,p3,p4)
::cLogFile := "C:\Log\Myapp\Log_Context.log")
::AddToLog("Init()")
Return SELF

METHOD Log_Context:Destroy()
::oldcontext:Destroy()
::AddToLog("Destroy()")
Return SELF

METHOD Log_Context:SetCargo(uVar)
::oldcontext:SetCargo(uVar)
::AddToLog("SetCargo(" + Var2Char(uVar) + ")")
Return uVar

METHOD Log_Context:GetCargo()
LOCAL uRet := ::oldcontext:GetCargo()
::AddToLog("GetVargo() = " + Var2Char(uRet))
Return uRet

METHOD Log_Context:AddToLog(cLog)
cLog := "ThreadId() = " + AllTrim(Str(ThreadId())) + " : " + cLog
Sy_addToLog(::cLogFile,cLog)
Return


FUNCTION Sy_AddToLog(cFile,cText)
Return Sy_AppendToLog(cFile,Chr(13) + Chr(10) + Dtoc(Date()) + " " + 
Left(Time(),8) + " : " + cText)

FUNCTION Sy_AppendToLog(cFile,cText)

LOCAL nHandle  := -1                                          File handle
LOCAL lOk      := FALSE                                      Default, 
error
LOCAL nBytes   := 0                                          Bytes 
written to file
LOCAL cString  := cText + Chr(13) + Chr(10)                  String + 
CR + LF

nHandle        := Fopen(cFile,FO_READWRITE)                  Open 
existing file
if nHandle < 0 .and. Ferror()= 2                             File not 
found
    nHandle     := Fcreate(cFile)                             Creat 
new empty file
endif
if nHandle > -1                                              File is open
    Fseek(nHandle,-2,FS_END)                                  Position 
to end of file - 2
    nBytes      := Fwrite(nHandle,cString)
    Fclose(nHandle)                                           Close file
    lOk         := nBytes = (Len(cString))                    All data 
written ?
endif
Return lOk




Op 15-6-2010 23:02, Allen Lee schreef:
> Hi All:
> Has anyone had session parameters dropped between screens?
>
> Scenerio example:
> Call oContext:setCargo() and store an 8 element array on first page.
> Call oContext:getCargo() on 5 subsequent pages
> Occasionally, a user will find the array undefined (not retrieved)
>
> The oContext:getCargo() could be successful on 4 pages and fail on the
> fifth ... OR fail on the third page.
>
> We know that it is not a programming issue because the same user could
> logout and try again later and everything works.
> I cannot reproduce this problem.
>
> Web server stats:
> Max Service Time: 15.64
> Avg Service Time: 0.14
> Worker Threads: 12
> Workload Peak: 2
>
> Would setting WAA_TRACE (off) or WAA_INTERNAL_LOG (off) to ON provide
> any clues?
>
> Could the issue by related to slow response time of the user's network?