Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Show "progress" of a process using pl/sql web toolkit?

Re: Show "progress" of a process using pl/sql web toolkit?

From: Billy <vslabs_at_onwe.co.za>
Date: 31 May 2005 06:07:08 -0700
Message-ID: <1117544828.816506.302110@g47g2000cwa.googlegroups.com>


Jeremy wrote:
> Platform: Oracle 9iR2 on Sun Solaris 9 with Oracle HTTP Server and
> mod_plsql
>
>
> We have made extensive use of the PL/SQL web toolkit (htp etc packages).
> Sometimes submitting a form may result in an update that takes some
> time. We would ideally like to be able to show the user some kind of
> progress indicator but I cannot work out if how this can be done - has
> anyone come up with any cunning solutions?
>
> I am thinking of a "refresh" set say to 5 seconds and which could show
> the progress of the task... the problem of course is communicating that
> progress.

Exactly. A web browser is a stateless block device. In the standard 2-tier client-server systems we write (using Delphi/C#/etc), we usually deal with character devices and stateful connections.

A good example of a character device is telnet. Every keystroke pressed is send to the server. The server sees every key and can respond interactively to each keypress - and statefully too.

The web service does not see every keystroke. It gets a data block at a time to process. A web services cannot echo "keystrokes" (responses) back interactively - it prepares a data block and when done it is returned to the web browser.

With MOD_PLSQL specifically, you use the HTP.PRN command for example to "write" data into this data block. When your PL/SQL code terminates, MOD_PLSQL reads this data block (residing as a package state struct in that Oracle session). MOD_PLSQL now writes the contents of this PL/SQL data block to an Apache struct. Apache streams this data block to the web browser.

There is nothing interactive here. Doing a HTP.PRN is writing to a buffer that will only be "flushed to the client" when your code terminates.

Of course, this also clearly demonstrates just how friggen stupid the HTTP protocol is for interactive applications. Shows that the emporer is indeed stark naked. But despite this, the industry persist with using the web for interactive client systems...

What really gets me is that we used block devices back in the 80's as the client interface. We used application servers backed in the 80's. We also had "thin" clients. AND IT WORKED DAMN WELL!

Then 2 tier client-server came along and changed that, only to go full circle back to what we did in the 80's... but only doing it in an absolutely crappy way.

Oh well..

--
Billy
Received on Tue May 31 2005 - 08:07:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US