Subject RE: [IBO] IBO components in a thread
Author Helen Borrie
At 09:55 PM 4/07/2006, you wrote:
>Just another note, I've created the same routine which loads the data in a
>standard Delphi app and it works flawlessly, so it must have something to do
>with the threads.

It certainly does.

Originally you wrote:

>
> > I actually do have other IBO components on the DataModule: They are: 1)
> > TB_SessionProps and 2) TIB_Events. I don't know if any of these two
> could
> > perhaps cause a problem?

What you need for *each thread* is its own TIB_Session object (as the
first data access object in the creation order of the module), along
with its own TIB_Connection, its own transactions, datasets etc.

As for events - OK - but again, your IB_Events has to be specific to
the session in the thread. It's fine for one thread to listen for
events that another thread might have posted (the world turns upon
such things!) but the callbacks must return to the
session-connection-ibevents that *registers* them.

"Error reading data from the connection" means you've crashed it the
connection, by the way - entirely expected behaviour with your setup. :-)

Helen