Re: sqlexit()
Posted in 1997
In article <340E111B.285F@127.0.0.1>, Mike Segel <Postmaster@127.0.0.1> writes >Jonathan Leffler wrote: >[SNIP] >You are right. After looking at sql_exit() >it should disconnect all references including the shared >memory segment so you should be able to effectively >shutdown Informix. > >Since I haven't had to write a 4GL program in 3+ years, I have >gotten a little rusty. (Yes there is life outside Informix ;-) > I have a 4gl menu application which a) loads menu items from a table b) allows submenus hence >1 cursor open at a time c) runs programs which are the actual "application" (>200 of them!). Since we license informix for 96 users we cannot have >96 database connections i.e >48 concurrent users. Therefore I added sqlexit to my menu program so that it disconnects when a menu options is run (Fancy code handles redeclaring, repreparing, reopening and repositioning all the open cursors when reconnecting!!). This means we can have the required 96 users WITHOUT having 96 unused database connections open. Note this menu program runs unchanged under a) 4GL 4.x/SE 4.x b) 4GL 6.0/SE 7.x c) 4GL 4.x/Online 5.x d) 4GL 6.x/OWS 7.x Then only problem I found was that under 4GL 4.x/SE 4.x after sqlexit() was called the 'sqlexec' process would not die but would become <defunct>. I assume this was because the 4GL process was not issuing a wait(2) call within the sqlexit() function. I added a wait(2) call without WNOHANG and the new function works fine and have been tested under ALL of the above. [Should cover all combinations except 4GL 3.x/SE 2.1x!!] -- David Williams