Subject Re: [IBO] Re: TIB_Session management
Author Hans
I understand from past discussions that each Thread must have its own

TIBOTable and TIBOQuery at first instance create a default session, unless
directed other wise, all threads will use the same defailt session.

So create a trhread with a Session and then set TBOTable->IB_Session to
the thread's IBOSession, simply using the assignment TIBOTable->IB_Session =
(the thread's) The owner in each thread of all IBOTables, TIBOQueries and
must be each threads own session.

----- Original Message -----
From: "kgdonn" <kd.ibo@...>
To: <>
Sent: Wednesday, October 26, 2005 3:36 PM
Subject: [IBO] Re: TIB_Session management

> I'm going to make an addendum to my own post based on what I've
> learned. I think my port will be simplified to use TIBODatabase
> instead of TIB_Connection and TIB_Transaction. I think I'll be OK
> if I just make sure that I have a TIBODatabase unique to each thread
> and that I take care that all my TIBOTables and TIBOQueries within a
> thread have their IB_Connection property set to the thread's
> TIBODatabase.
> Now the docs for TIB_Session.DefaultSession say, "By default, each
> new thread will automatically generate its own component session.
> So, if you are doing multi-threaded database access just make sure
> that each new thread has its own connection, transaction, etc. and
> that it does not access any resource of other threads." Based upon
> this it seems I can completely ignore the IB_Session property of
> both TIBODatabase and TIBODataset. When a TIB_Session is required,
> the components will call TIB_Session.DefaultSession which will
> automatically be unique to the current thread and be used by all IBO
> components within that thread if I just never specify it explicitly,
> correct?
> Now, if the above is all true, does it remain all true even if I'm
> doing everything in code and my components have Owner=nil? Also
> does DefaultSession work correctly even if there is no TThread
> object for the current thread, for example, if the thread was
> created by a web server calling into my ISAPI module?
> Thanks,
> Kevin Donn
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> - your IBO community resource for Tech Info
> papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links