Skip to Main Content
  • Questions
  • BEFORE Triggers Fired Multiple Times

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, Marat.

Asked: April 24, 2007 - 1:03 pm UTC

Last updated: November 18, 2017 - 2:18 pm UTC

Version: 10.2

Viewed 1000+ times

You Asked

Dear Tom,
I have a question about triggers execution:
according to documentation at http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_triggers.htm#sthref1169

"BEFORE Triggers Fired Multiple Times

If an UPDATE or DELETE statement detects a conflict with a concurrent UPDATE, then Oracle Database performs a transparent ROLLBACK to SAVEPOINT and restarts the update. This can occur many times before the statement completes successfully. Each time the statement is restarted, the BEFORE statement trigger is fired again. The rollback to savepoint does not undo changes to any package variables referenced in the trigger. Your package should include a counter variable to detect this situation."

Could you explain this? I tried to repeat the situation described in documentation (that is, fire a trigger for a table being modified in another transaction), but the trigger fired only once.

Thank you.

and Tom said...

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Very nice!

Marat Tolgambayev, April 24, 2007 - 2:57 pm UTC

Thanks, Tom!
Now this question is clear to me!

Links dead

Norbert, November 17, 2017 - 10:27 am UTC

sadly, the links of part II and part III are dead - the articles were great!
Connor McDonald
November 18, 2017 - 2:18 pm UTC

Sorry - I'll get those links uploaded.

Please check again in a couple of days

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library