Solved

Web forms session terminated by closing the browser

Posted on 2002-07-26
8
2,208 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 48

Expert Comment

by:schwertner
ID: 7181710
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
ID: 7181720
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 48

Expert Comment

by:schwertner
ID: 7181820
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:sora
ID: 7181840
In which HTML file is this set?

sora
0
 
LVL 48

Accepted Solution

by:
schwertner earned 150 total points
ID: 7184525
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
ID: 7184551
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 48

Expert Comment

by:schwertner
ID: 7184571
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
ID: 7184581
Thanks a tonne!


sora
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

705 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