05-01-05 11:05 PM
Hi all,
I have a program written in C with embeded SQL. Following are the
configuration:
DB2/LINUX 8.1.5
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
My problems are as following
CASE 1:
In DB2's documentation, it is stated that sqleintr is safe to call in a
signal handler. When my program is executing a SQL, it receives an
interrupt. In the signal handler for the interrupt, it calls sqleintr()
to stop the SQL and call exit() to exit the program. Sometime the
program will hang when calling sqleintr because of pthread in DB2
cannot accquire a lock and the program goes into a deadlock (from the
gdb dump ). I guest the lock is accquire somewhere during the excution
of the SQL before the signal and it is not yet released.
CASE 2:
Same as above but the program sometime hang when calling exit(). From
the gdb dump, exit() will call some clean up functions in DB2 and the
cleanup function itself goes into a dead lock as well.
For your information, I need to exit the program after the signal
handler is called.
Does anyone encounter this problem before? I have search around at the
DB2 documnetation but still can't find related information. Please
help.
Thanks.
[ Post a follow-up to this message ]
|