Solved

Oracle Forms:  TIMER not firing?!?

Posted on 2001-08-16
6
4,466 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses

623 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