Skip to main content
Question

Custom events-trigger after 5 mins

  • Feb 16, 2023 9:36 AM UTC
  • 4 replies
  • 283 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)
  • Feb 16, 2023 10:08 AM UTC

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
  • Feb 16, 2023 11:01 AM UTC

This is not working. Error pops up saying; 

 


Link
Superhero (Customer)
Forum|alt.badge.img+23
  • Superhero (Customer)
  • Feb 16, 2023 1:45 PM UTC

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

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.