473,790 Members | 2,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using Autonomous transaction

Sam
Guys,
I have a question regarding oracle.

I have a stored procedure executing a number of statements including
delete , select and lots of inserts in one big procedure and main
transaction

I have a stored procedure sp_log_action with a PRAGMA AUTONOMOUS
TRANSACTION defined which is called after each statement in the main
stored procedure(this writes the event to a table).

When i run with one session, the main procedure, it runs as expected
i.e even if there is a error in the main stored Proc, it logs an
error.

But when i run from multiple sessions , it returns me a "deadlock
detected while waiting for resource" error.

It seems to me a locking problem. can u suggest me a way around this.
Or am I doing the right thing to log a event . ???
Any suggestions will be helpful!!

thanks,
Shyam Pillai
Jul 19 '05 #1
2 7890
I doubt that the AUTONOMOUS TRANSACTION has anything to do with the
deadlock error. AUTONOMOUS TRANSACTION can cause deadlock error if it
tries to modify the same record its parent transaction is modifying.
If you are simply doing message logging in the AUTONOMOUS TRANSACTION
routine, deadlock should not occurr. Most likely the deadlock is
caused by the DML statements in the parent transaction. If you have
the following situation, deadlock will occurr:

Session 1 Session 2
--------- --------------
delete row 1
delete row 2
delete row 2
delete row 1
- Jusung Yang
sh******@yahoo. com (Sam) wrote in message news:<56******* *************** ****@posting.go ogle.com>...
Guys,
I have a question regarding oracle.

I have a stored procedure executing a number of statements including
delete , select and lots of inserts in one big procedure and main
transaction

I have a stored procedure sp_log_action with a PRAGMA AUTONOMOUS
TRANSACTION defined which is called after each statement in the main
stored procedure(this writes the event to a table).

When i run with one session, the main procedure, it runs as expected
i.e even if there is a error in the main stored Proc, it logs an
error.

But when i run from multiple sessions , it returns me a "deadlock
detected while waiting for resource" error.

It seems to me a locking problem. can u suggest me a way around this.
Or am I doing the right thing to log a event . ???
Any suggestions will be helpful!!

thanks,
Shyam Pillai

Jul 19 '05 #2
sh******@yahoo. com (Sam) wrote in message news:<56******* *************** ****@posting.go ogle.com>...
Guys,
I have a question regarding oracle.

I have a stored procedure executing a number of statements including
delete , select and lots of inserts in one big procedure and main
transaction

I have a stored procedure sp_log_action with a PRAGMA AUTONOMOUS
TRANSACTION defined which is called after each statement in the main
stored procedure(this writes the event to a table).
After every statement? You really need that detailed of a trace?
When i run with one session, the main procedure, it runs as expected
i.e even if there is a error in the main stored Proc, it logs an
error.

But when i run from multiple sessions , it returns me a "deadlock
detected while waiting for resource" error.

It seems to me a locking problem. can u suggest me a way around this.
Or am I doing the right thing to log a event . ???
Any suggestions will be helpful!!

thanks,
Shyam Pillai

Is it the called procedure or something else? have you tried removing
the calls to that Proc? What is the specific error message?

Details, Man, we want details! 8^)
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4488
by: Dan Loomis | last post by:
Hi guys - I have a weird condition here I'm trying to get resolution on, and unfortunately I'm not getting anywhere with my friends at Oracle. I'm hoping it's something simple, or at the very least it's a documented bug that I can simply reference and move on. The following code and session output (I think) documents a condition where a procedure marked for an automomous commit is commiting an INSERT over a database link that is outside...
4
6475
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to define the servername / hostname in my Perl Progrem.. Here is the code:
3
2094
by: Saket Mundra | last post by:
I have multiple web forms in my application. The user after logging on is directed to form1 where he enters information desired. Once finished he is directed to form2 and the same procedure goes on till form6. After user has entered information in all 6 forms the information needs to be entered in the database by performing a Transaction. If the data from any of the forms is missing the Transaction is rolled back. My query is where do i...
4
3681
by: Daniel Daoust | last post by:
Hi, knowing that "autonomous transaction" (Oracle concept of) are not yet implemented in PostgreSQL, has anyone found a work-around. I need to preserve database states from a potential rollback and then log them inside database tables. What about: 1) using memory structures to hold the info, then commit to the database just before exit (after the
3
4208
by: Jason Huang | last post by:
Hi, MyForm is a C# Windows Form. MyFom has 3 GroupBoxes. Now I wanna update data from the textboxes in those 3 GroupBoxes. I have function Update1 for GroupBox1 to update table Table1, Update2 for GroupBox2 to update table Table2, Update3 for GroupBox3 to update table Table3. And there is a function TotalUpdate for MyForm. The function TotalUpdate comprises of Update1, Update2, and Update3.
5
14111
by: dilippanda | last post by:
Hi Experts, I want to know what is the use of pragma autonomous transaction in PL/SQL. In which condition should we use this? Please guide me with an example. Thanks, Dilip
1
1685
AdusumalliGopikumar
by: AdusumalliGopikumar | last post by:
Where we can't use Autonomous transaction?
0
10696
debasisdas
by: debasisdas | last post by:
PRAGMA:-Signifies that the statement is a pragma (compiler directive). Pragmas are processed at compile time, not at run time. They pass information to the compiler. A pragma is an instruction to the Oracle compiler that tells it to do something. In this case you are telling Oracle to associate an error that you choose to a variable that you choose. This pragma must go in the declarative section of your block. Types of PRAGMA...
2
274
by: Sam | last post by:
Guys, I have a question regarding oracle. I have a stored procedure executing a number of statements including delete , select and lots of inserts in one big procedure and main transaction I have a stored procedure sp_log_action with a PRAGMA AUTONOMOUS TRANSACTION defined which is called after each statement in the main stored procedure(this writes the event to a table).
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10413
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.