Oracle Forms - Loosing focus when a Timer expires

Posted on 2010-11-15
Last Modified: 2012-05-10
We are implementing a Timer in our Oracle Forms application to implement an Emergency Broadcast solution. The Timer is set on our 'welcome' form, when the timer expires the form checks whether an emergency message has been added to the database and displays it.

This works, however we have noticed some undesirable effects on other screens when the timer expires - focus is momentarily switches back to the 'welcome' screen and interrupts user activity. In some cases the cursor goes back to column 1 of a field, other times a canvas is incorrectly displayed and also an opened menu is removed from display.

We can work-around most of these side-effects, although a solution to the removal of an open menu is eluding us. But we are worried about other un-noticed side-effects.

Is there any way we can configure the timer without it switching focus back to its form when it expires? Or is there another way we can regularly check whether data has been added to the database?

Many thanks
Question by:Peter_at_fjs
  • 3
  • 3
LVL 22

Assisted Solution

by:Helena Marková
Helena Marková earned 100 total points
ID: 34144142
I would put When-Timer-Expired trigger to every form. Then you can easily do what you want on particular form when trigger expires.
LVL 35

Expert Comment

by:Mark Geerlings
ID: 34144921
I agree with Henka.  I would not depend on a When-Timer-Expired trigger to do only and exactly what you want, if that is in a form that is not the currently-active form.

If you want some logic to be available from any/all of your forms, I would put that logic in a procedure (or function) in a *.PLL file that you attach to all of your forms.  It will be difficult though in Oracle Forms to automatically have every form query the database at particular intervals, regardless of what the operator is doing in the form at the time.  You could easily add a call to this (*.PLL-based) procedure in each When-New-Form-Instance trigger and write a Key-Exit trigger in each form that does the same.  If you want this check to happen automatically in between those events, you could use a When-Timer-Expired trigger in each form.  If your application allows the users to have multiple forms open, but only one active, you may need to add logic to your procedure to first determine whether the form is currently active or not.

Author Comment

ID: 34146590
We've performed a trial on your comment, it doesn't work, so I may have misunderstood.

1) Started a Timer from our 'Welcome' form

2) When-Timer-Expired triggers was put onto 3 forms, but when the timer elapsed the only trigger that fired was the one on the original 'welcome' form, rather than the active ones.

Focus then switches back to the 'welcome' form for an instance causing us the problems.

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 35

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 400 total points
ID: 34146795
Note this "Usage Note" from the Oracle Forms documentation for When-Timer-Expired triggers:

"The When-Timer-Expired trigger can not fire during trigger, navigation, or transaction processing."

(Yes, that line does look like it was written by a non-native speaker of English.  It seems to either be missing a word or two, or to have an unexpected comma or two.)

There are some limitations on when a When-Timer-Expired trigger can fire (basically when the user is inactive in the form).

I think it is possible in a trigger to investigate the call stack to determine if the form currently is active or not.  That may vary depending on whether you use the OPEN_FORM or CALL_FORM command to launch additional forms.

If not, it would be easy to add a non-displayed, non-base table field (maybe in a non-base-table "control" block) in your original 'welcome' form that you set to a non-null value when another form is launched.  The When-Timer-Expired trigger in that 'welcome' form can check the value of this field, and do nothing if it is non-null.  The trigger that does the CALL_FORM or OPEN_FORM should clear this value after the user returns to the 'welcome" form.  That way, you may be able to use a When-Timer-Expired trigger in each of the other forms to do the action you want there.

Accepted Solution

Peter_at_fjs earned 0 total points
ID: 34186137
We have decided to 'work around' the problem. We have made changes to properties of two of our subclassed items. This has fixed the majority of the knock-on effects of the timer expiring.

We think the reason why the suggested solutions didn't work is that the timer is a session timer and we open all new forms with new database sessions.

The only remaining issue is that if the user opens a menu on another form when the timer expires the menu disappears. We don't think that we can fix this and as the timer is 5 minutes long we are hoping that it will not be too much of a problem. We did program a mechanism so that the timer can be switched off if it proves too problematic.

If you can offer advice on the menu disappearing I would appreciate it.
LVL 35

Expert Comment

by:Mark Geerlings
ID: 34192479
Which mechanism do you use to open the called forms: CALL_FORM or OPEN_FORM?

Author Closing Comment

ID: 34328773
Whilst we work-around our issues with timers, I am happy to allocate the points to those who tried to help. I have awarded 100 points to Henka for being the first respond and the 400 points to markgeer for spending the most effort.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle - SQL Query with Function 3 53
Not able to drop or recreate an Oracle stored procedure 1 38
UTL_FILE invalid file operation 5 24
Help with Oracle IF statment 5 23
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

839 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