Subject Re: [IBO] IBO inside a dll
Author Martijn Tonies

"Geoff Worboys" <geoff@...> schreef in bericht
> > 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).

I already have a TIB_SessionProps and I set the 'usedefaultsession' to

> 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

I don't have any components at forms or data modules - everything is
created in code now.

> 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.

Jups, noticed that method -- but not all components have it
(TIBOQuery for example) - but I think when you link a TIBOxxx
to a TIB_Connection it uses the session from that TIB_Connection
component... right?

Martijn Tonies
Upscene Productions

InterBase Workbench - The Developer Tool for InterBase

"Experience is what you get when you didn't get what you wanted"