>Huh?
>
>I'm missing something. Yes, you can set it in the Init.
>
>However, if I've got a bizobject which is always around (say, called gobizobject), based on Custom, doesn't it always just use the datasession in effect whenever it is called? gobizobject.Post(something) .... ???
>
James,
Any non-session class ( ie not form, toolbar with private datasession or Session class) inherits the session from the object that created that object
easy to test - create a couple of the class below in different datasessions - and look at its DataSessionId
define class ThaClass as Custom
DataSessionId = 0
protected function Init()
local Success
Success = TRUE
do case
case !m.Success
case !DoDefault()
assert FALSE
Success = FALSE
case !AddProperty(m.this, 'DataSessionId', set('dataSession'))
assert FALSE
Success = FALSE
endcase
return m.Success
endfunc
Calling a method of an object always runs in the datasession the object was created in
eg
I create a Session object ( say it has datasession 5). I then call a method of the session object which creates an custom object and returns it.
The returned object will have datasession 5
If you dereference the session object but keep its returned object alive, datasession 5 will not close
What do you do if you want the datasession of the returned object to be one ?
You create an object at app startup (with datasession 1) and attach it to _screen.
If from the session object, I call the screen object to create an object and return it, the returned object will have datasession one
Gregory