Subject | RE: RE: [IBO] IBO and threads |
---|---|
Author | IBO Support List |
Post date | 2013-09-11T19:21:26Z |
Perhaps give me a little better idea of what you are doing and
I can give you a specific example.
If you like, I can take some time and look at your project via
TeamViewer and give suggestions directly.
Jason
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf Of soerensoerensen@...
Sent: Wednesday, September 11, 2013 10:55 AM
To: IBObjects@yahoogroups.com
Subject: RE: RE: [IBO] IBO and threads
I would prefer the code solution, but how do I create a second instance of TIB_session, TIB_Cursor, TIB_connection? Could some one provide me with an example please!
--- In IBObjects@yahoogroups.com, <ibobjects@yahoogroups.com> wrote:
I recommend making a data module to hold everything that goes
together.
Put a TIB_Session and however many TIB_Connection, TIB_Query,
etc. components you need on that module.
Then, whe you have a need for it to be used, create a TThread
and an instance of that DataModule and marry the two
together.
You can also just do it in code without a data module. I
normally start by creating a TIB_Session instance and then thereafter I use that
instance as the Owner when I create the subsequent connections, queries, etc.
Then, I have the thread do whatever is needed within that TIB_Session
context.
The rule of thumb is as long as you only have a thread active
within a single TIB_Session's full context you are thread
safe.
Jason
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf Of soerensoerensen@...
Sent: Tuesday, September 10, 2013 11:47 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] IBO and threads
I'm developing a threaded server and use IBO and Delphi XE4. But how do I create a IBconnection, IBcursor and IBsession for each thread? I tried putting the creation under threadvar. I can compile but gets a runtime error (read access error)