Re: sqlexit funny behavior
Posted in 1997
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
andy lennard wrote: > > We had a similar problem, which was caused by opening a pipe after having > attached to a database. > > Normally sqlturbo is blocked on a read from the pipe it has > established with the client app. sqlexit closes this pipe at the > client end, sqlturbo gets an error and closes down. > > However, after our popen the fds have been duplicated in the forked > process (including the database connection) and the sqlturbo sits > waiting on this instead. No error is generated and so sqlexit hangs. > > The fix was to either to pclose before sqlexit, or re-do popen to close > unnecessary fds. > > Hope that helps. > > Andy. > > > > > We have several server-type applications when started, open a database, > > read tables for initialization, close the database via E/SQL and then > > remain idle for hours or days until called upon. This situation seemed > > perfect for sqlexit to free the database resources used during > > initialization. When the servers' initialization are finished, sqlexit is > > called after the CLOSE DATABASE statement. > > > > The problem appears when the server wakes up, does its work, closes > > the database and then calls sqlexit for the second time. From the > > debugger, the server goes into an infinite loop inside sqlexit. The > > stack track shows an infinite loop in the following routines: > > > > sqlexit > > killbackend > > wait > > _wait_sys > > $cerror > > > > The ESQL product is INFORMIX-ESQL Version 5.03.UC1 > > The On-Line server is RSAM Version 5.03.UC1 > > The hardware and OS are HP-UX 09.01 A 9000/755 and > > HP-UX 10.20 A 9000/755. > > > > The sqlexit routine would be a very nice thing to have working > > properly in these server applications. What I am doing wrong? > > > > Any help and/or advice would be appreciated on this. > > > > Thanks! > > > > mgo > > > > -------------------==== Posted via Deja News ====----------------------- > > http://www.dejanews.com/ Search, Read, Post to Usenet > > > > -- > =-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-= > Andy Lennard andy@kontron.demon.co.uk > =-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-= I have a server which handles pager switch requests that has teh same problem. I can run it in non-threaded, foreground mode and it gets the same hangup when I use sqlexit. Here's the traceback: (dbx) where [1] wait(0xeffff414, 0x0, 0x0, 0x0, 0x63f44, 0x0), at 0xef6f85ac [2] killbackend(0xc, 0x0, 0x63f50, 0x67bb9, 0x67bb9, 0x0), at 0x48508 [3] sqlexit(0x0, 0x40, 0xeffff520, 0xa, 0x1, 0xa), at 0x3946c [4] CloseDB(), at 0x2c848 =>[5] Terminate(sig = 15, pname = 0x64790 "pswip"), line 189 in "/home/dorgant/r f/libsw/term.c" [6] main(argc = 8, argv = 0xeffff614), line 439 in "main.c" This is a real problem because when the database is brought down, the old sqlturbo process will not reconnect when the database is back online. so, I have to kill it by hand (when I find it). Not good server behaviour. I need to have this call work so the foregoing will work. Im running 5.04. Yeah,yeah, I know, just upgrade to 7.x and the birds will sing and the sun will shine....