Home » Other » General » Where else to use AUTONOMOUS TRANSACTION (Generic)
Where else to use AUTONOMOUS TRANSACTION [message #630107] |
Sat, 20 December 2014 09:05 |
manubatham20
Messages: 566 Registered: September 2010 Location: Seattle, WA, USA
|
Senior Member |
|
|
Hi,
The below is just for knowledge sharing.
All the time I am reading posts regarding AUTONOMOUS TRANSACTION, and it's always suggested, don't use AUTONOMOUS TRANSACTION anywhere except ERROR LOGGING, as it may cause your data to be in-consistent, and integrity issues may arise.
In an interview someone asked me two questions consecutively-
1. Have you ever used pipelined function in Oracle?
2. What are AUTONOMOUS_TRANSACTIONS?
I think he wanted to listen, why and how to use AUTONOMOUS TRANSACTION with PIPELINE functions.
I will suggest to read below:
Combining PIPE ROW with AUTONOMOUS_TRANSACTION
Regards,
Manu
|
|
|
|
|
|
|
|
Re: Where else to use AUTONOMOUS TRANSACTION [message #630116 is a reply to message #630115] |
Sat, 20 December 2014 10:11 |
manubatham20
Messages: 566 Registered: September 2010 Location: Seattle, WA, USA
|
Senior Member |
|
|
I can't debate on this small thing. It has less importance, that's why I posted in General forum, not in SQL.
It's just for information, so anybody can read it, whoever want to.
My question should be,
"Where else should I use AUTONOMOUS TRANSACTION"
But I think, I will find out over time, can you please delete this topic.
I will really appreciate that.
Manu
|
|
|
|
|
|
Re: Where else to use AUTONOMOUS TRANSACTION [message #630120 is a reply to message #630119] |
Sat, 20 December 2014 10:49 |
John Watson
Messages: 8960 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Quote:And what happens if the invoice is cancelled afterwards? This is something I've had to deal with, too. Auditors do NOT like gaps in business document numbes, and in some jurisdictions it may even be illegal in some circumstances. A cancelled invoice is not te same as a missing invoice. As DBAs or developers, we just to accept the instructions, silly though they may be.
Manu, I think the best way to spread knowledge (and yes, the topic you found is interesting) is to write it up as a blog article. Why not do that?
|
|
|
|
Re: Where else to use AUTONOMOUS TRANSACTION [message #630130 is a reply to message #630129] |
Sat, 20 December 2014 12:27 |
manubatham20
Messages: 566 Registered: September 2010 Location: Seattle, WA, USA
|
Senior Member |
|
|
Thanks Littlefoot and Michel.
For Littlefoot,
I am able to understand fully, as may be I am not aware, how invoice sequences are used further. I understood, select for update will lock it, so that no other transactions can use it, autonomous will commit regardless of the main calling transaction, but why it's pipelined.
The thing I have in my mind regarding pipelined functions is that on the fly processing, without getting complete result set in one go. As soon as you will get the data you will start processing it further. Like in data warehouses, where there are many intermediate transformations dependent on each other, and we don't really want to wait for a stage to be complete, there we use pipelined function.
I never wrote a blog, but let me try this for very first time (may be around new year).
For Michael,
I read many things without any use, and when the time comes, I at least know the direction in which I have to explore.
Combining PIPE ROW with AUTONOMOUS_TRANSACTION
A restriction on combining table functions and PRAGMA AUTONOMOUS_TRANSACTION has been introduced in the 10g (10.1) release because table functions pass control back and forth to a calling routine as rows are produced. If a table function is part of an autonomous transaction, it must COMMIT or ROLLBACK before each PIPE ROW statement to avoid an error in the calling subprogram.
I read that, but I don't understand that. Requesting you, Can you give me any simple test case/scenario, where I have to have to use this (AUTONOMOUS TRANSACTION with PIPELINED FUNCTION), and I will prepare data and try to code the scenario.
P.S You guys are always helpful, but the way you help is sometimes odd.
Thanks,
Manu
|
|
|
|
|
Goto Forum:
Current Time: Mon Nov 25 21:50:44 CST 2024
|