Subject Transaction Timeout w/Multithreaded app
Author Bjørge Sæther
Hi !

I am working on an application that does a complex analysis (with no users
connected),
including ascii file imports, creating / dropping tables, indexes,
storedprocs, etc., and a number of insert / update calls. It all ends up in
a "read only" database for user reports. The entire process may take from 15
minutes to 6 hrs, building databases of some 100MB to 6GB (so far).

To make it easier to follow the process and watch progress, I've created a
multithreaded application. It's running a number of "steps" in a separate
thread. The application typically has 4 connections - 2 in Main Thread and 2
in the "worker thread". Both have their own TIB_Session and TIB_Transaction
components, created in the thread. The application is recently moved from
BDE to IBO, and apart from some surprises (some of which you have heard) it
runs smoothly.
Until yesterday. A procedure that externally is run within 3:30 minutes
makes the GUI freeze after some 2 minutes. It struck me that I had seen
something with "tieout", and started investigating TIB_Transaction. I guess
I found the error - a timeout value of 120 seconds !
Now it seems to me that this timeout call results in the application ending
up in a deadlock - it freezes and remains so for ever, using no CPU.
Changed the timeout value to 65000, and the problem should be gone, I guess.

Q#1: "Is there some setting I've been missing here, or a cardinal error
being done by me ?"

For this particular application, there is actually no need for transaction
handling at all - in fact, it only causes trouble. Exceptions are frequently
appearing, as the configuartion of the application involves a large number
of settings, and input data may contain the strangest errors.

Q#2: How should I use transactions to avoid trouble and minimize need for
database sweeps ?

Thanks in advance !

--
Regards,

Bj�rge S�ther
bjorge@haha_itte.no