Solved

Web forms session terminated by closing the browser

Posted on 2002-07-26
8
2,080 Views
Last Modified: 2007-11-27
What happens to a web forms session that has been terminated by closing the browser and without using the EXIT buttons etc coded inside the application?

We have forms sessions which perform two kinds of updates

 - Base Table updates
 - Directly execute DML into the database by stored procs

What happens in either case if after some changes are made the user closes the browser?

I have found that when DML is executed and the browser is closed or crashes, and if the user opens another browser and tries to amend the same set of data, the second sessions waits on the locks which are not yet released by the first session.

What is a fool proof way to get around applications from hanging by waiting on such locks?

How can an exit from the browser be prevented?

How can cleanup action/rollbacks etc be done in forms when the browser is closed? How can forms detect it in the first place?

I am aware of the FORMS60_TIMEOUT but don't think this is good enough since we can't set it to too less a time and if we don't then there is a possibility that the user may open another session quicly and wait on the unreleased locks from his previous session which is still not terminated


sora
0
Comment
Question by:sora
  • 4
  • 4
8 Comments
 
LVL 47

Expert Comment

by:schwertner
Comment Utility
You can not manipulate the browser - it is independent.

The main question is what happend after the browser is death or the user is inactive. Oracle Server proces the both events at same. here is defined an idle period gor the Forms Server. After this period it closes the connection and terminates the Oracle session.

So you have to use this mechanism, described below.




If you are on Windows Machine than go to
Registry->Hkey_Local_Machine->Software->Oracle

Look at the FORMS60_TIMEOUT parameter.
Set it to 30.
The default value is 15 (minutes!)
This parameter specifies the amount of time in elapsed minutes before Forms server process is terminated when there is no client communication with the Forms server.

More details:

You are running forms on the web and want the ability to automatically
close a client connection and release the forms web process if a
client remains idle for a particular amount of time. For example, say
you have many users performing data entry and you want to conserve
resources as much as possible. You can implement a five minute maximum
idle time to users, after which their connection is lost and the
ifweb60 process is shut down, which frees resources.

Terminating a User Session Based on Idle Time in Forms 6i
=========================================================
Follow this procedure to terminate a user session based on idle time
in Forms 6i (Forms 6.0.8.8 or higher):

1) Create a registry/environment variable called FORMS60_TIMEOUT.

2) Set FORMS60_TIMEOUT to a value of 5. This parameter specifies the
  amount of time in elapsed minutes before the Forms Server process
  is terminated when there is no client communication with the Forms
  Server.  The default is 15, and valid values are integers
  between 1 - 1440 (1 day.)  For example:

  FORMS60_TIMEOUT=5

3) In your html file, insert a new parameter called heartBeat. This
  parameter sets the frequency at which a client sends a packet to
  the server to indicate that it is still running. The default value
  is two minutes. Set this parameter value to greater than the value
  specified for the FORMS60_TIMEOUT variable. For example, set it to
  7 minutes as follows after the serverArgs parameter:

  For Internet Explorer:

  <PARAM NAME="heartBeat" VALUE="7">

  For Netscape Browser:

  heartBeat="7"

Now, if a user is idle, (that is, if they do not use their form for
five minutes) the connection is lost and the ifweb60.exe process for
that user is automatically terminated.

Note: When the ifweb60 process is terminated, the client process is
     not notified, and therefore no message is displayed on the
     client side. For the user, it appears that their session is
     hung. The user must close all browser windows to restart the
     application. Please consider this when implementing this
     functionality.

Solution Explanation
====================
The ifweb60.exe timeout depends upon the heartBeat parameter. When a
client is idle, a packet is sent every two minutes to the client and
even though it is idle, it still finds it alive. If the packet finds
the client dead, it terminates the ifweb60 process after 15 minutes
(the default for FORMS60_TIMEOUT.) If you set the value of
FORMS60_TIMEOUT to less than the value of heartBeat, the forms server
does not get a reply from the client within the specified timeout
period and it thinks the client is stopped and terminates the
ifweb60.exe process.
0
 
LVL 5

Author Comment

by:sora
Comment Utility
I am aware of the FORMS60_TIMEOUT but don't think this is good enough since we can't set it to too less a time and if we don't then there is a possibility that the user may open another session quicly and wait on the unreleased locks from his previous session which is still not terminated

sora
0
 
LVL 47

Expert Comment

by:schwertner
Comment Utility
I am not speaking only about FORMS60_TIMEOUT. You have to consider also the functionality of the heartBeat parameter.

Concentrate on the following passage about heartBeat:

This parameter sets the frequency at which a client sends a packet to the server to indicate that it is still running.
0
 
LVL 5

Author Comment

by:sora
Comment Utility
In which HTML file is this set?

sora
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 47

Accepted Solution

by:
schwertner earned 150 total points
Comment Utility
I mean the Base HTML config. file and its Heartbeat parameter. I thought about your problem in the weekend. If I am not wrong setting the Heartbeat parameter gives you the possibility to set FORM60_TIMEOUT parameter to very low value, let us say 1 minute. In fact the problem arises because the HTML protocol is not simetric - Info is set to the browser, but info from browser is not so reach.


Configuring the Base HTML File (base.htm or base*.htm - please find in on the Forms Server machine):
When a user first starts a Web-enabled application (by clicking a link to the
application’s URL), an HTML file is downloaded from the application server to the
user’s Web browser. This initial HTML file is called the base HTML file. It contains
all necessary tags, parameters, and parameter values required to run the selected
application on the Web.
The base HTML file is constructed dynamically when you use the cartridge
implementation. At runtime, the Forms Server dynamically creates a new HTML
file by merging information from the following sources:
n The application’s cartridge HTML file
n The application’s cartridge settings
n The application’s URL
The new (dynamically-created) HTML file then downloads to the user’s Web
browser.
The easiest way to create a base HTML file is to modify one of the provided
template files. The following templates are available in the %FORSM60%\server
directory:
n basejini.htm: This is a base HTML file containing the tags required to run the
Forms applet using Oracle JInitiator. It is suitable for browsers (only on
Windows platforms) certified by Oracle to work in this manner (and which do
not work using standard APPLET tags). See Section 5.4.2.4, "Default
basejini.htm File".
n base.htm: This is a base HTML file containing the APPLET tags required to run
the Forms applet in the AppletViewer, or in any Web browser certified by
Oracle whose native JVM is certified with Forms. See Section 5.4.2.3, "Default
base.htm File".
To create a base HTML file:
1. Copy the base.htm or basejinit.htm template file to create your application’s
base HTML file. You can find this template in the %FORSM60%\server
directory.
2. Open the template file and rename it, for example, order.htm.


ABOUT HeartBeat parameter:

heartBeat optional Use this parameter to set the frequency at which a client sends a
packet to the server to indicate that it is still running. Define this
integer value in minutes. The default is two minutes.
0
 
LVL 5

Author Comment

by:sora
Comment Utility
Thanks a lot Schwertner.

We implemented this last weekend and what I did is as follows:

The problem mainly happens because we call stored procs/functions etc from the forms - and these stored procs would perform DML which would create locks.

I made all the callable procs as AUTONOMOUS transaction and either did a commit or rollback to ensure that no locks would exist once the stored procedure completed.

ANyway I think this is a BIG hole in Oracle forms at the moment. What do you think?

sora
0
 
LVL 47

Expert Comment

by:schwertner
Comment Utility
Yes,
it is so. But nothing is perfect in the world. Thank you very much for the information.
0
 
LVL 5

Author Comment

by:sora
Comment Utility
Thanks a tonne!


sora
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now