USEGEAR

导航

datasnap的监督功能【2】-管理Session

1、服务端的Session是有TDSSession定义的。TDSSession提供了许多有用的方法和特性,再开发室取得服务or重要信息。

如Session状态、安排Session独享定时or自动执行工作,or在Session对象中暂时存储数据等。

              方法                                       说明                                          
function HasData(Key : String):Boolean 判断Session对象中是否存有字符串数据
function GetData(Key : String):String 根据键值取得字符串数据
Procedure PutData(Key , Value : String) 把键值/字符串save to Session对象中
Procedure RemoveData(Key : String)  
function HasObject(Key : String) : Boolean  
function GetObject(Key : String) : TObject  
function PutObject(Key : String;Value :TObject):Boolean         
function RemoveObject(Key : String; InstanceOwner : Boolean=True):TObject  

 

 

 

 

 

 

 

 

 

 

2、TDSSessionManager管理Session对象
注意,整个DataSnap服务器中只有一个TDSSessionManager对象。

 

posted on 2020-08-21 14:04  USEGEAR  阅读(393)  评论(0编辑  收藏  举报