Solved

Oracle Forms:  TIMER not firing?!?

Posted on 2001-08-16
6
4,348 Views
Last Modified: 2007-12-19
I'm creating a timer in my PRE-FORM trigger using this code, but it doesn't seem to fire:

TimerID := find_timer ('EditTimer');
if not id_null (TimerID) then
   delete_timer (TimerID);
else
   TimerID := create_timer ('EditTimer', 1000, REPEAT); -- Fires every 1 second.
end if;

In my form WHEN-TIMER-EXPIRED trigger, I am current trying to display an alert and enable/disable some buttons to test this timer, but nothing happens.  I don't think the WHEN-TIMER-EXPIRED trigger is ever run.

I am new to Oracle and may be making a simple mistake--this is my first attempt at a timer.  Any suggestions?

Thanks,
Brian
0
Comment
Question by:bek
  • 3
  • 2
6 Comments
 
LVL 5

Accepted Solution

by:
ser6398 earned 50 total points
ID: 6393972
Some notes about WHEN-TIMER-EXPIRED:

Make sure the WHEN-TIMER-EXPIRED trigger is defined at the FORMS level.

The When-Timer-Expired trigger can not fire during trigger, navigation, or transaction processing.  If something is held up in processing, the timer will not expire until the processing is complete.

You can call GET_APPLICATION_PROPERTY(TIMER_NAME) in a When-Timer-Expired trigger to determine the name of the most recently expired timer. Make sure you use the exact same TIMER_NAME.



0
 

Author Comment

by:bek
ID: 6394080
I moved the timer initialization code to the WHEN-NEW-FORM-INSTANCE and it works.  Apparently, PRE-FORM wasn't a good place to put it.  Any idea why?  I'm not exactly sure when these triggers execute, in relation to each other.

-Brian
0
 
LVL 5

Expert Comment

by:ser6398
ID: 6394117
PRE-Form fires first, then WHEN-NEW-FORM-INSTANCE.
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 5

Expert Comment

by:ser6398
ID: 6394135
CREATE_TIMER lists the following restriction:
If there is no When-Timer-Expired trigger defined at the execution of a timer, and the timer is a repeating timer, subsequent repetitions are canceled, but the timer is retained.

Perhaps creating a timer in PRE-FORM allows it to fire before Forms has a chance to see the WHEN-TIMER-EXPIRED trigger?
0
 
LVL 6

Expert Comment

by:Jankovsky
ID: 6397256
I think, try make next change:

TimerID := find_timer ('EditTimer');
if not id_null (TimerID) then
  delete_timer (TimerID);
end if;--else
  TimerID := create_timer ('EditTimer', 1000, REPEAT);
--end if;

I usualy use this in WHEN-NEW-FORM-INSTANCE, not in PRE-FORM.

Bob



0
 

Author Comment

by:bek
ID: 6397314
Thanks, everyone!
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.

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

943 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

5 Experts available now in Live!

Get 1:1 Help Now