Solved

Oracle Forms:  TIMER not firing?!?

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to recover a database from a user managed backup

830 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