Subject TIB_Session management
Author kgdonn
I'm trying to get a handle on managing TIB_Session in my
application. I've rooted around in the source a good bit and the
documentation and the mailing list and I think I have things pretty
well nailed down, but this is such fundamentally important stuff I
want to get some affirmation before I continue with my port. The
best discussion I've found is the thread beginning with message
#29046 on 1/4/2004. In this thread Jason outlines three usage cases
for TIB_Session, briefly 1) no multithreading; 2) multithreading
with datamodules; and 3) everything in code. I am squarely in camp
3, but then Jason further says that the convention for this case is
that the Ownership chain is used to associate TIB_Session with
datasets. Unfortunately the architecture I'm porting allows for the
routine creation of datasets with nil owners. Hence my trepidation.

Now, the other author in the thread suggested that datasets should
get their TIB_Session setting via their associated TIB_Connection.
I think Jason embraced this idea and there was some discussion of
its implementation. I've looked through the release notes, however,
and not seen any indication that this ever did actually make its way
into IBO. If it did, I should be in pretty good shape. If it
didn't, then I've got some issues.

None of the code in my architecture directly uses TTable or TQuery.
It all uses my own TPortableTable and TPortableQuery in which I have
all my BDE/IB portability code. These classes derive from either
TTable/TQuery or TIBOTable/TIBOQuery depending on compiler
definitions. Originally the portability layer was for BDE and IBX
but I've completely given up on IBX and switched to IBO. My code
catches the assignment of DatabaseName for tables and queries and
uses this opportunity to assign the proper connection component. If
at this time, I also assign IB_Session from the proper IB_Connection
to the dataset's IB_Session property, will I be in good shape, i.e.
playing within the design rules, even if my components may or may
not have Owner=nil?

Thanks!
Kevin Donn