Skip to main content
Question

Custom events-trigger after 5 mins

  • February 16, 2023
  • 4 replies
  • 242 views

Forum|alt.badge.img+3

I have created a Custom Event for Email. I need the system to send the mail after few minutes from trigger point. Is there any possibility to do that? 

4 replies

Link
Superhero (Customer)
Forum|alt.badge.img+23
  • Superhero (Customer)
  • February 16, 2023

Hi @rukshan1114 

yes, it is possible with this chode: dbms_lock.sleep(120);

In my example it will be trigged after 2 minutes.

 

DECLARE
 
BEGIN
DBMS_LOCK.SLEEP (120);
 
END;

Forum|alt.badge.img+3
  • Author
  • Do Gooder
  • February 16, 2023

This is not working. Error pops up saying; 

 


Link
Superhero (Customer)
Forum|alt.badge.img+23
  • Superhero (Customer)
  • February 16, 2023

Hi @rukshan1114 

can you check if you can see SYS.DBMS_LOCK on your database?

Maybe the package DBMS_LOCK is not installed on you database or you haven’t the permissions.

You should be able to see it with IFSAPP.

 


Forum|alt.badge.img+21
  • Superhero (Employee)
  • February 17, 2023

I just want to warn you that if you use dbms_lock.sleep the transaction the event is triggered in is  also waiting the time you specify.

Depending on which transaction you put this in it can lead to problems with locks, so you need to be careful. Also if this is a transaction in the background job queue it might stop the queue from processing more background jobs.