Home » SQL & PL/SQL » SQL & PL/SQL » Commit problem
Commit problem [message #10922] Tue, 24 February 2004 18:40 Go to next message
resy
Messages: 86
Registered: December 2003
Member
hi,

Im facing a problem.

I've a trigger which is getting fired while afteer insertion (statement)of a table.But that parent statement is not getting commited. I do wanna parent insert into be commited before firing the trigger or before trying to do some actions inside my trigger..

 

any kind of suggestions??thanx.

 
Re: Commit problem [message #10927 is a reply to message #10922] Tue, 24 February 2004 20:21 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Any DML in a trigger (except for autonomous transactions) is part of the transaction to which the originating statement belongs. There is no way to commit the originating statement before trigger execution.

If it needs to be a separate transaction, than it needs to be called explicitly after you commit.
Re: Commit problem [message #10929 is a reply to message #10927] Tue, 24 February 2004 21:29 Go to previous messageGo to next message
resy
Messages: 86
Registered: December 2003
Member
thanx.

but im using autonomous transaction.
so there is any chance to commit the parent transaction?
Autonomous transation? [message #10935 is a reply to message #10927] Tue, 24 February 2004 23:55 Go to previous messageGo to next message
saravanan
Messages: 70
Registered: October 2000
Member
Dear friends,

can you help me what is autonomous transaction. can explain me pls give me an example.

Saravanan
Re: Autonomous transation? [message #10942 is a reply to message #10935] Wed, 25 February 2004 03:27 Go to previous messageGo to next message
resy
Messages: 86
Registered: December 2003
Member
http://www.samoratech.com/PLSQL/TIPautonomousTrans.htm

http://www.dbasupport.com/oracle/ora9i/autonomoustrans.shtml

http://asia.cnet.com/itmanager/tech/0,39006407,39128893,00.htm

http://www.aaoug.org/pres/Brave%20New%20World%208i%209i%20-one%20hour.ppt
Re: Autonomous transation? [message #11032 is a reply to message #10935] Tue, 02 March 2004 07:57 Go to previous message
tony martin
Messages: 4
Registered: July 2003
Junior Member
dear saravanan,

i hav a testimonial abt autonomous transaction a real life saver

every proc or function we write calls a procedure called s_pr_log_error() which basically logs an entry into a table called error log..for eg if an upload of file fails we pass an entry into this table telling which validation has failed. now the prob i had was since the calling proc has failed it will rollback the enitre operation including the entry i pass to error log table using s_pr_log_error.to counter this we declared in the proc s_pr_log_error , PRAGMA AUTONOMOUS TRANSACTION . now even whtever i logged into the error log alone got committed although the calling function or proc had rollbacked its activity. well that did the job
Previous Topic: Nmbers to Arabic in Words
Next Topic: process cell by cell dynamically
Goto Forum:
  


Current Time: Thu Apr 18 17:09:46 CDT 2024