Solved

Oracle Forms:  TIMER not firing?!?

Posted on 2001-08-16
6
4,329 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.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
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 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 explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

760 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

22 Experts available now in Live!

Get 1:1 Help Now