Subject deadlock with ibobjects
Author Guenther SOMMER
i've a application with some gui-elemnts, which request some data from
the database, and a background thread, which resolves some data-input
againts the database and then does a screen update via synchronize...
after some time, the application freezes, because the main-thread and
the background thread go into a deadlock in gds.dll

i'm using a seperate ib_session component for the main and the
background thread....

what i am doing wrong...

init of background thread:

//generate database conncetion

DBThreadSession = new TIB_Session(0);
DBThreadConnection=new TIB_Connection(DBThreadSession);
DBThreadConnection->IB_Session=DBThreadSession;
DBThreadCursor= new TIB_Cursor(DBThreadSession);
DBThreadCursor->IB_Connection=DBThreadConnection;
DBThreadCursor->IB_Session=DBThreadSession;


DBThreadSession->DefaultConnection=DBThreadConnection;

DBThreadConnection->DatabaseName=Global.LocalDBFile;
DBThreadConnection->Username="abc";
DBThreadConnection->Password="def";
DBThreadConnection->Open();

DBThreadCursor->IB_Connection=DBThreadConnection;


init of main-thread:

// create database objects
FormMain->TISessionDatabase=new TIB_Session(FormMain);
FormMain->TIBDatabase=new TIB_Connection(FormMain->TISessionDatabase);
FormMain->TISessionServerDatabase=new TIB_Session(FormMain);
FormMain->TIBServerDatabase=new
TIB_Connection(FormMain->TISessionServerDatabase);

FormMain->TIBDatabase->DatabaseName=Global.LocalDBFile;
FormMain->TIBDatabase->Username="atcscc";
FormMain->TIBDatabase->Password="atcscc";

FormMain->TIBDatabase->Open();


any help would be apprecicated.

thanx, guenther sommer.

--
Günther Sommer
PDTS GmbH, A 1150 Wien, Moeringgasse 20
Tel. +43 (1) 526 17 57 / 151
FAX +43 (1) 526 17 57 / 199
mailto:guenther.sommer@...
www.pdts.at