You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

[ |../../index.htm#lansa/vlwebeng03_0190.htm]
現在地:

21.5 Web アプリケーションのセッション期限切れ

次のようなメッセージが表示される場合は、サーバー・モジュールのセッションの期限が切れていて、クライアント側でこのエラーが検知されなかったことが考えられます。

次の例は、XDemoWebSessions をベースにしています。以下のようなコードを使用した場合、#TestSession.Failed により検知・処理されるため、このようなセッション期限切れの致命的なエラーは発生しません。
Evtroutine Handling(#Test.Click)
 
#Com_owner.TestSession
 
Endroutine
 
Mthroutine Name(TestSession)
 
Define_Com Class(#xDemoSessionServices.TestSessionState) Name(#TestSession)
 
#io$sts := ""
#Test.Caption := "Testing Session"
 
#TestSession.ExecuteAsync( #Io$sts )
 
Evtroutine Handling(#TestSession.Completed)
 
#Com_owner.UpdateSession( True )
 
#Test.Caption := "Test (Success)"
 
Endroutine
 
Evtroutine Handling(#TestSession.Failed) Reason(#Reason) Handled(#Handled)
 
#Handled := True
 
Case (#Reason)
 
  When (= Unknown)
 
  #Test.Caption := "Test (Failed)"
 
  When (= SessionInvalid)
 
  #Test.Caption := "Test (Session Invalid)"
 
Endcase
 
#Com_owner.UpdateSession( False )
 
Endroutine
 
コードを修正して #TestSession.Failed の処理部分を削除すると、セッションの期限が切れると、上記のようなメッセージが表示されます。
 
Evtroutine Handling(#Test.Click)
 
#Com_owner.TestSession
 
Endroutine
 
Mthroutine Name(TestSession)
 
Define_Com Class(#xDemoSessionServices.TestSessionState) Name(#TestSession)
 
#io$sts := ""
#Test.Caption := "Testing Session"
 
#TestSession.ExecuteAsync( #Io$sts )
 
Evtroutine Handling(#TestSession.Completed)
 
#Com_owner.UpdateSession( True )
 
#Test.Caption := "Test (Success)"
 
Endroutine
 
Evtroutine Handling(#TestSession.Failed) Reason(#Reason) Handled(#Handled)
 

  • ここの処理はなし
     
    Endroutine
     
    [ |../../index.htm#lansa/vlwebeng03_0190.htm]
  • No labels