Home » SQL & PL/SQL » SQL & PL/SQL » what is autonomous pragma transaction in function and procedure
what is autonomous pragma transaction in function and procedure [message #135976] Mon, 05 September 2005 03:58 Go to next message
dsuresh99
Messages: 1
Registered: September 2005
Location: chennai,india
Junior Member
what is autonomous pragma transaction in function and procedure

[Updated on: Mon, 05 September 2005 04:46]

Report message to a moderator

Re: what is autonomous pragma transaction in function and procedure [message #135997 is a reply to message #135976] Mon, 05 September 2005 05:44 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
From the mauals

The AUTONOMOUS_TRANSACTION pragma instructs the PL/SQL compiler to mark a routine as autonomous (independent). An autonomous transaction is an independent transaction started by another transaction, the main transaction. Autonomous transactions let you suspend the main transaction, do SQL operations, commit or roll back those operations, then resume the main transaction.


If you don't know where to find the online documentation, read the sticky ( first post in the forum ) or go to the site's homepage, and click 'advanced options' next to the search button.

MHE
Re: what is autonomous pragma transaction in function and procedure [message #319696 is a reply to message #135997] Mon, 12 May 2008 13:24 Go to previous messageGo to next message
dasgupta.amitava@gmail
Messages: 32
Registered: November 2007
Member
Hi all,
few days back I came accross the PRAGMA AUTONOMOUS_TRANSACTION clause in pl/sql. Can anybody tell me that whether an autonomous transaction suspends the main transaction or not?? i.e. the main transaction and the auto. transaction can run at the same or the main transaction has to wait for the auto. transaction...


Thanks in advance
Amitava.............
Re: what is autonomous pragma transaction in function and procedure [message #319700 is a reply to message #319696] Mon, 12 May 2008 13:51 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The main transaction is suspended during the execution of the autonomous transaction but it is still there with its locks and modifications that the autonomous transaction can't see.

Regards
Michel
Re: what is autonomous pragma transaction in function and procedure [message #319753 is a reply to message #135976] Mon, 12 May 2008 23:26 Go to previous messageGo to next message
srinu_erp
Messages: 3
Registered: January 2008
Junior Member
Hi,

If uyou define a pl/sql block as an autonomous transaction then if there are any changes to the parent block will not effect the child block. An autonomous transaction may end with commit or rollback and one autonomous transaction per one pl/sql block is allowed.

regards,
srinu

[Updated on: Mon, 12 May 2008 23:26]

Report message to a moderator

Re: what is autonomous pragma transaction in function and procedure [message #319853 is a reply to message #319753] Tue, 13 May 2008 04:01 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
one autonomous transaction per one pl/sql block is allowed.

Not really. A pl/sql block is either Autonomous, or not, depending on whether the PRagma is included in the Declare section, but a Pl/Sql block may execute as many different autonomous transactions as it likes.
Re: what is autonomous pragma transaction in function and procedure [message #319855 is a reply to message #319853] Tue, 13 May 2008 04:04 Go to previous message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I.e. there are no limits but resource limits.
Previous Topic: execution
Next Topic: Merging multiple rows into single row
Goto Forum:
  


Current Time: Sun Dec 04 17:00:10 CST 2016

Total time taken to generate the page: 0.13100 seconds