Subject Re: [IBO] IBO inside a dll
Author Geoff Worboys
> One more question: to be on the safe side, is it okay to create a
> TIB_Session for each connection? If I build this now, it would be
> a lot easier when I implement multi-threading later on...

Its safe but it can get more complicated, and I guess it uses
additional resource (but not much as far as I can tell).

The various IBO components are setup so that the standard
.Create(AOwner: TComponent) constructor will create the component
attached to the default TIB_Session instance (the first session
created when the application/thread starts).

You can assign to the IB_Session property to alter which instances of
TIB_Session is associated with the component.

If you are creating components in code then you can use the special
CreateForSession( AOwner: TComponent; ASession: TIB_Session )
constructor which will create the component associated with the
required session.

I have used the latter (CreateForSession) in multi-threaded apps. I
have never actually tried a direct assignment to the IB_Session
property of ibo components, but the feature does exist.


Geoff Worboys
Telesis Computing