Ingres user count problem
Posted in 1993
[ Article crossposted from comp.databases.ingres ] [ Author was John Oliver ] [ Posted on 17 Sep 93 03:48:38 GMT ] Can any Informix guru out there solve this problem? We needed a dynamic menu system for our Informix based application: dynamic meaning the menu tree is stored in the database itself. This allows modules to be added to the application without recompiling, the menu structure to be changed on the fly etc. However, Informix 4GL does not allow the CALL instruction with a variable function name. The call-menu module however, needs to be able to invoke another 4GL module without knowing its name at comile time. The obvious solution is to do something like: run "fglgo ",module_name The problems with this are: a) you get dozens of fglgo and shell processes lying around waiting on their children and b) you can only navigate from node to connected node on the tree; we needed to be able to jump from/to any node. OK, we wrote a caller function in C that simply exec's a new fglgo process, supplying the required module name, i.e: execp("fglgo", module_name, 0); When such a processs terminates, it looks up it's parent in the menu tree, and invokes it in the same way. Of couse it doesn't tidy up the Informix dbms session, but what the hell.... Right, everything's just peachy now.. but wait! If I jump between modules 15 times, the program crashes with an error claiming that the maximum number of database sessions has been exceeded. Apparently, when a new fglgo is exec'd, the dbms doesn't know that the old one has died. What we need is a way of gracefully disconnecting from the dbms before execing the new process. Phew! OK, anybody got the no doubt blindingly obvious solution? BTW/FWIW: we're running Informix 4.10, Turbo engine on RS6000/AIX3.2. ___________________________________________________________________________ John Oliver | CORE Management Systems Ltd | This signature intentionally left bland. oliverj@eymsl.co.nz |