trigger clock

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
  

Poston Mon, 08 Aug 2005 3:22 pm

My question is as follows: a trigger is fired only after the commit of an action, i.e. when rollback occurs the trigger is not activated?

Could someone explain to me this case?!? Thanks! : wink:
edu4rdo
Location: Tijucas/SC

Poston Mon, 08 Aug 2005 4:13 pm

Don't.
If trigger AFTER INSERT, UPDATE, DELETE, she's round after the INSERT, UPDATE, or DELETE statements. (for each row individually!)

If trigger wheel BEFORE, before.

Example: AFTER UPDATE TRIGGER: For each line that is made, the update trigger is fired-> right after the change of each line. It's not just the commit.
dr_gori
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?
http://glufke.net/oracle/search.php?search_id=unanswered

Poston Mon, 08 Aug 2005 4:19 pm

dr_gori, thank you for your interest in my question.

By the way, I would like to know more in the case of rollback.
I have how to make a planned action in a trigger only in the cases of commit, i.e. ignoring the cases when rollback?

Thank you!
edu4rdo
Location: Tijucas/SC

Poston Mon, 08 Aug 2005 4:52 pm

It is possible with AUTONOMOUS_TRANSACTION (oane in forum) i.e. the trigger wheel in another session. If you do rollback, won't make a difference none in another session.

But beware, this sort of thing should be well thought out and WELL TESTED. Remember that, in this case, you cannot insert rows in a child table, because when you give give ROLLBACK problem. (you'll be doing just rollback the parent table and the child, you know?)

What do you do with it? Some kind of LOG?
Explain what you want to do what the people here usually give a hint!
dr_gori
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?
http://glufke.net/oracle/search.php?search_id=unanswered

Poston Tue, 09 Aug 2005 10:36 am

My case is synchronization between Oracle and Active Directory. When a register is altered/inserted into the database, I want the AD is also changed.
But I just want to raise my WebService (responsible for sync) when it is effected the commit.
And therein lies my doubt. When knowing that it was really done the commit via trigger ?
edu4rdo
Location: Tijucas/SC



Return to PL/SQL

Who is online

Users browsing this forum: No registered users and 5 guests