Re: please help me enter the modern age
Answered: green (solid confidence) — The asker (looking to move legacy 4GL-as-CGI code to a persistent-connection Web architecture) confirms that Linux + Apache + mod_perl + Apache::DBI + DBI::Informix would let him do everything he needs, with existing IIUG CGI-for-4GL modules also offered as a lower-effort path; he only notes a personal dislike of Perl, not a technical gap.
Advisory only.
Posted in 2000
Topics: Stored Procedures & SPL, Connectivity: ODBC / JDBC / .NET, Connectivity: ESQL/C, 4GL & Embedded SQL, Java & JDBC Development
Richard You could use PHP (compile with with-informix) or Java servlets (with Informix JDBC). Both allow you to open a server connection for a session and keep it open for the duration of the session. PHP being a scripting language is obviously easier to implement. Neither of them would allow you to drive off your existing work in 4GL however. I did hear about a CGI module for 4GL, but I never worked on it. Dont even know if it exists, or if it is a product of my wishful thinking <g>, Just my $ 0.02 Sujit Richard Puchalsky <rpuchalsky@mediaone.net> on 01/07/2000 11:24:30 AM Please respond to Richard Puchalsky <rpuchalsky@mediaone.net> To: informix-list@iiug.org cc: Subject: please help me enter the modern age I am working on a system that I built many, many years ago, near the beginning of the Web. It used to provide information to people through a BBS (remember those?) linked to 4gl programs that searched an Informix database. When the Web came along, we used 4gl programs as CGI; in other words, when someone filled out a Web form to specify which data they wanted, the Web server would send that information to a Unix shell program, which would start a 4gl program, which would take the user input out of Unix environment variables, then do a sequence of procedural steps to retrieve information from the Informix database and format the information as an HTML file, which it would then present to the user as a Web page through a series of display statements. Clunky, but it worked. Actually it still does work; it's still up and running. Now this is not the way you're supposed to run a modern Web-linked database. The approved current method is to have your Web server directly be the client for the database server and continuously hold open a connection between the two. That avoids all of the overhead, whenever someone wants to search the database, of forking a new Unix process, starting a new copy of 4gl, and making a new connection to the database server. The web server keeps a connection to the db server open at all times through a set of Unix processes and uses threads within these processes to handle different requests. OK, now I'm looking at all of those old 4gl programs. Is there any way for me to incorporate this old work into a new architecture? Does Informix even support this kind of architecture? If I can't use 4gl, what kind of programming language should I use? (It has to be procedural; there's no way I can do the things I need to do with plain SQL.) Is there anything that could be used that's at least similar to 4gl in programming structure? I plan on staying in Unix or Linux, not NT. Can any wise guru out there advise me? I tried to look at the Informix Web page for answers to these questions, but quickly got lost.
<Sujit.Pal@bankofamerica.com> wrote: > You could use PHP (compile with with-informix) or Java servlets (with Informix > JDBC). Both allow you to open a server connection for a session and keep it open > for the duration of the session. PHP being a scripting language is obviously > easier to implement. I'll try to look into PHP, thanks ... but I'm not sure if opening a server connection for a session is what I want. If each Web hit is a separate "session", then I would still have to fork a new process for each Web hit. I don't know anything about PHP so I may have the wrong idea here. Paul Storm <paulst@rainmakersystems.com> wrote: > My first take would be to go with PERL. You can grandfather the > 4GL and CGI stuff, get procedures, open language support, and > a migration path. Also PERL is freely available for download. Thanks again, but wouldn't this have the same problem? The Web server would receive user-entered form data from someone's Web client, fork a Unix process to run the Perl program, and the Perl program would presumably have embedded SQL in it that it would send to the database server. Doesn't this put you into the same area of having each Web hit fork a Unix process and start a new connection to the database server? It seems like this would replace the 4gl as CGI with Perl as CGI. That would probably be better, but I'm trying to get rid of the CGI altogether by having the Web server be the only database client. Or does Apache do something where you can run Perl programs inside it without spawning separate processes?
Richard Puchalsky <rpuchalsky@mediaone.net> wrote: > > Thanks again, but wouldn't this have the same problem? The Web server would > receive user-entered form data from someone's Web client, fork a Unix > process to run the Perl program, and the Perl program would presumably have > embedded SQL in it that it would send to the database server. Doesn't this > put you into the same area of having each Web hit fork a Unix process and > start a new connection to the database server? It seems like this would > replace the 4gl as CGI with Perl as CGI. That would probably be better, but > I'm trying to get rid of the CGI altogether by having the Web server be the > only database client. Or does Apache do something where you can run Perl > programs inside it without spawning separate processes? > For a Perl program you might use mod_perl with the Apache HTTP server and the Perl module Apache::DBI which maintains persistent database connections for you - for more on Apache/mod_perl see <http://perl.apache.org> and you can read about Apache::DBI at : <http://search.cpan.org/doc/MERGL/ApacheDBI-0.87/DBI.pm> /J\\ -- "Teletext - the information super B-road" - Exclusive, Channel 5
Sujit.Pal@bankofamerica.com wrote: > > I did hear about a CGI module for 4GL, but I never worked on it. Dont even know > if it exists, or if it is a product of my wishful thinking <g>, > There are at least two CGI modules for 4GL available from the IIUG archive: <ftp://ftp.iiug.org/pub/informix/pub/cgi_4gl.Z> <ftp://ftp.iiug.org/pub/informix/pub/i4glcgi/i4glcgi-1.00.tar.gz> I have used the former of those and it works fine - the advantage being that if you have a large body of 4GL code it reduces the work involved in converting it to use the CGI in comparison to rewriting it all in (say) Perl ... /J\\ -- "The teenage masturbators of today are the television executives of tomorrow" - Melissa Cabriolet, Drop the Dead Donkey
Jonathan Stowe <gellyfish@gellyfish.com> wrote: > For a Perl program you might use mod_perl with the Apache HTTP server and > the Perl module Apache::DBI which maintains persistent database connections > for you Thanks! If I read the directions rightly, I should be able do everything by using Linux, Apache, mod_perl, Apache::DBI, and DBI::Informix, and programming everything in Perl. I'd still rather avoid that, because I don't find Perl to be a particularly friendly language, but it's good to know that the option is there.