Subject Re: [IBO] IBO, Firebird and StoredProcedure as run and forget
Author russellbelding
Thanks for comments Helen. I am developing the code in the main thread of my program first, doing some timing tests and will then estimate how much could be gained by using a separate thread for processing a stored procedure parallel to the main thread. If I do this I'll think about posting an example here.

The Embarcadero Samples section has a TTHREAD example using sorting. It shows one way to use TThread but is sparse in its use of TThread.

Russell

--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>
> At 07:02 p.m. 22/04/2013, russellbelding wrote:
>
> >Not having used threads before and reading that "things" need to be "thread-safe" I am looking for comments. (why re-invent a wheel?)
> >
> >Will my new thread need its own TIB_CONNECTION and TIB_TRANSACTION?
> >Are these IBO objects "thread-safe"?
>
> The thread must be in its own separate TIB_Session. Emphasis on MUST.
>
> >Are there samples anywhere?
>
> The Threads project in Samples should light the way.
>
> >Overall I am seeking to make put some Firebird server processing into a the backgound and give a main program an apparent boost in speed as results from stored procedures running in separate threads are not needed by other parts of the program. Only if there is a failure in the SP do I need to intervene.
>
> You can catch exceptions in the SP and use a handler to go past them and log them. That's not in IBO's bailiwick, though.
>
> Helen
>