Question

Custom events-trigger after 5 mins

  • 16 February 2023
  • 4 replies
  • 144 views

Badge +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

Userlevel 7
Badge +22

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;
Badge +3

This is not working. Error pops up saying; 

 

Userlevel 7
Badge +22

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.

 

Userlevel 7
Badge +19

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.

Reply