Subject Re: [IBO] IBO in multi-treaded app
Author bnuckels@midrid.com
You must use TCP/IP protocol to avoid problems. You can still connect to
a local IB server using "localhost". This is a limitation of IB, not IBO.
---------
Brian Nuckels
MRG Document Technologies




"mbuczer" <mirek.buczkowski@...>
Sent by: news@...
02/21/2003 03:47 AM
Please respond to IBObjects


To: IBObjects@yahoogroups.com
cc:
Subject: [IBO] IBO in multi-treaded app


Hi

I use BCP 5.0 & FireBird 1.0.2 in my projects and now I want to change
IBX
on IBO4.0.
I want to build multi-treaded application.
Inside my Datamodule, creation order is:
- TIB_Session
- TIB_Connection (Protocol=cpLocal)
- TIB_Transaction
- TIB_DSQL (with update SQL command)

Within TThread I am creating Datamodule dynamicaly:

//--------------------------------------------------------------------------
-

__fastcall TMyThread::TMyThread()
: TThread(true)
{
FreeOnTerminate = true;
dm = new TMyDatamodule( Application );
}


void __fastcall TMyThread::Execute()
{
dm->IBC1->Connect();

//---- Place thread code here ----
while(!Terminated){
//dm->IBT1->StartTransaction();
dm->IB_DSQL1->Prepare();
dm->IB_DSQL1->Params->ParamByName("dt3")->AsDateTime =
TDateTime::CurrentDateTime();
dm->IB_DSQL1->ExecSQL();
dm->IBT1->Commit();
//
Sleep(1000);
}
dm->IBC1->Disconnect();
}

//--------------------------------------------------------------------------
-

When the thread is working and I want create and execute this Datamodule
in
main thread,
then program execution is stopped - I suppose is after
TIB_Connection.Connect();


In IBO samples I saw in TIB_Connection.Protocol is cpTCP_IP - is it
required
for multi-thread application?


What is wrong? Have You got any idea?

PS: My english is not excelent. Sorry if all is not clear.




___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/