Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Oracle Forms:  TIMER not firing?!?

Posted on 2001-08-16
6
Medium Priority
?
4,554 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 200 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
Industry Leaders: 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

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

Industry Leaders: 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!

Question has a verified solution.

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

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

879 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