Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
will it drain when create trigger?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Thu Sep 20, 2012 5:15 pm    Post subject: will it drain when create trigger?
Reply with quote

I wonder if DB2 will drain out when trigger is created on the tables that are being used by online transactions? I cannot find out the answer from DB2 manuals.

on the other side, will DB2 drain when trigger is dropped?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Sep 20, 2012 6:46 pm    Post subject:
Reply with quote

you drain a resource.
a trigger is not a resource, it is a set of actions.
once a trigger is CREATed successfully, the actions will be available.
once a trigger is DROPped successfully, the actions are no-longer available.

to answer what I think is your implied question:
if there are 20 UPDATE transactions queued against a table,
and the CREATE Trigger is successful before the 10th transaction starts,
then the actions of the trigger will be available for the 10th.
the first 9 do not have the benefit of the Trigger.

If the above is true, the converse (DROP) would be true.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Thu Sep 20, 2012 8:24 pm    Post subject:
Reply with quote

I did a test as below:
first, in my test program, I issue update statement against a table, and then I suspend the execution for 30 seconds before commit by issue 'EXEC CICS DELAY' statement in order to sustain the lock of the table.

then , I run the program.

after the program starts running, I did below test SEPARATELY:
1. I issue 'CREATE TRIGGER' statement against the table that the test program is updating. The result shows 'CREATE TRIGGER' statement was executed successfully as soon as it is issued.
2. I issue 'DROP TRIGGER' statement (the trigger to be dropped is created in test case 1) when the test program starts running. Results shows the 'DROP TRIGGER' SQL statement was not executed until the test program ends.

so, I got below conclusion:
'CREATE TRIGGER' DOES NOT need to drain, while 'DROP TRIGGER' needs to drain.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Sep 20, 2012 8:53 pm    Post subject:
Reply with quote

fine,
but,
the program running with the lock and delay did not employ the trigger during the Create.
but the program running with the lock and delay were employing the trigger, so the trigger could not be removed until the program finished (a commit).

but you have isolated the situation with only one program running.

what about multilple programs and then map out the effect

my suppositions still stand:
once the trigger is created, then it takes effect.
once the trigger is deleted, then it stops taking effect.

you are not using the term drain properly.
a trigger is not a resource. the table is a resource.
you are not draining anything, if you are waiting for a 'lock' to be released.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts How do I create a mainframe monitorin... anjali.bisht All Other Mainframe Topics 4 Fri Sep 01, 2017 2:20 pm
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts How do you create Eclipse based dialogs jasorn IBM Tools 0 Thu Aug 03, 2017 5:05 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us