Subject Re: [IBO] Unexplained behavior from DefaultSession
Author Geoff Worboys
> Since no-one seems to have answered you, I guess I can try
> (though the main benefit from me answering will probably be
> to remind Geoff and Jason about your problem).

Whoops, I thought I had, but can see now that I didnt;


Bill,

The main thing I was wondering was whether you were setting up the
components on the separate thread via a datamodule (as in the Threads
sample application) or whether you were creating the various thread
components (TIB_Session, TIB_Component etc) in code?

And in either instance the interesting question then becomes; At what
point are you creating the components? You need to be careful about
whether the components are created in the context of the main thread
or the separate thread - since the "default" session will be
different.

When creating components for separate threads in code I tend to always
use the CreateForSession constructor so that the I can be certain that
the dataset or whatever is certain to be using the specific session
that I want it to. eg.

Transact := TIB_Transaction.CreateForSession(Self, MySession);


Maybe this helps?

Geoff Worboys
Telesis Computing