Re:IBX and thread issues - TeamB
Quote
Ruaan Barnard wrote:
> I just want to make something clear or make sure that I understand it
> correctly.
> In our main app we create a TIBDatabase component and establishes a
> connection.
> We then pass the handle of this connection between our dll's so that only
> one connection is used.
That's fine.
Quote
> The way we use this is as follows:
> We have a custom datamodule with a tibdatabase on it .In the dll we create
> the dm and assign the created connection's handle to it.
> This works perfectly.
...as it should.
Quote
> Now for threads. I understand the issues regarding threads. Unique
> connection and tcp/ip.
> What I want to know what is the correct way to use it:
> 1) Create a TIBDatabase component,establish a unique connection and the pass
> it to multiple instances of the datamodule
> throughout the thread.
As long as the connection is being used by only one thread at a time,
you can share it between as many DMs as you want. For example, if you
create 27 DMs in a single thread and use them concurrently within the
thread, that's fine. If you create 27 DMs, each in their own thread,
then they'll all need their own connection to IB.
Quote
> The way I understand it is that I must create one unique datamodule with one
> unique connection and use it throughout the thread.
No, you can have many DMs in the thread using the same IB connection.
I do this in my DataSnap servers.
-Craig
--
Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
Delphi/InterBase WebLog: http://delphi.weblogs.com