Subject Re: [IBO] IB & Threads
Author Helen Borrie

At 07:58 AM 22-10-01 +0000, you wrote:
>Dear Members,
>sorry for my long descripton of my problem
>I have two threads:
> tdbindexlist_SpeicherUebersicht
> tdbindexlist_zurBearbeitung
>Every thread has his own:
> ib_Connection.reset(new TIB_Connection(NULL));
> ib_Transaction.reset(new TIB_Transaction(NULL));
> ib_Query.reset(new TIB_Query(NULL));
> ib_DataSource.reset(new TIB_DataSource(NULL));
> ib_Cursor.reset(new TIB_Cursor(NULL));^
>which will be created in the constructor of the object


Each thread must have its own TIB_Session.


>the code above runs without any problems if the IB-Server is located
>on a seperate PC.
>If the IB-Server is on the same PC it works only if i start one
>thread wait for finish and then i start the second

InterBase is not thread-safe when you connect directly. When running threaded connections on the same PC, use the local TCP/IP loopback method, to connect to the localhost server (IP address Place an entry in your HOSTS file if localhost is not recognised already.


All for Open and Open for All
InterBase Developer Initiative ยท