Oninit® 4gl2everywhere
Oninit® 4gl2everywhere is a Linux, multithreaded, C-language listener that sits between compiled Informix 4GL applications and a non-Informix backend. On the front end the bridge speaks the Informix client/server (SQLI) wire protocol; on the back end it dispatches through a uniform backend interface to PostgreSQL, Oracle, MySQL, or a built-in null mock for protocol bring-up. The SQL translation between the two is structured as a three-stage inspectable pipeline — a parser, a dialect-independent intermediate representation, and a per-target rewriter — so Informix-specific SQL constructs are handled structurally rather than by string substitution.
The 4GL binary is unaware of the bridge. Stock c4gl-compiled applications connect, log in, prepare and execute statements, fetch rows, and disconnect through the bridge using the exact SQLI token stream they were originally built for — no recompilation, no source change, no driver swap on the client side.
The bridge is built for production: one thread per session with configurable session caps; signal-driven graceful drain on SIGTERM / SIGINT; SIGHUP runtime reload of logging and SQL trace; per-listener log and sqltrace overrides with field-level fallback to global defaults; and self-rotating logs. Broken sessions cannot crash the listener. Errors back to the 4GL client carry the canonical IFXBRIDGE:CATEGORY:DETAIL format on SQ_ERR so 4GL programs can match on category.
At a glance
| Topic | Detail |
|---|---|
| Front-end | Speaks the Informix client/server SQLI wire protocol; accepts stock c4gl-compiled clients unchanged. |
| Translation | Parser —> AST —> dialect-independent IR —> per-target rewrite. Each stage is inspectable. |
| Backends | PostgreSQL (libpq), MySQL / MariaDB (libmysqlclient), Oracle (OCI), and a built-in null mock for protocol bring-up. Conditional compile per target. |
| Threading | One thread per session, configurable session cap per listener, SQLCODE -746 with IFXBRIDGE:CONNECTION_LIMIT on cap-rejection. |
| Failure isolation | Broken sessions cannot crash the listener; client misbehaviour is contained to the offending session. |
| Graceful drain | SIGTERM / SIGINT stop accepting and wait for in-flight sessions to finish; SIGHUP reloads logging and sqltrace settings without dropping sessions. |
| Multi-listener | One listener per port; each has its own backend, session cap, and optional log / sqltrace overrides with field-level fallback to globals. |
| Database verb mapping | SQ_DBOPEN translates to SET search_path on PostgreSQL, mysql_select_db on MySQL, ALTER SESSION SET CURRENT_SCHEMA on Oracle. Bind, fetch, commit, rollback dispatch through a uniform vtable. |
| SQL trace | Per-session SQL trace files under a configurable directory; filename_pattern tokens (%p, %t, %s) for sortable per-session files. |
| Logging | Thread-safe, self-rotating; configurable level (normal, verbose, debug, sqltrace); CLI overrides -v / -d / -s. |
| Errors | Canonical IFXBRIDGE:CATEGORY:DETAIL wire format on SQ_ERR; categories include PROTOCOL, BACKEND, CONFIG, INTERNAL, CONNECTION_LIMIT, SHUTDOWN, BACKEND_DOWN. |
| Deployment | Linux daemon; depends on libc + pthreads + libyaml plus the target client library for the configured backend. No JVM, no interpreter, no proprietary runtime. |