Thanks Sitarama Chakravarthy. Hi Tom, Sorry to bother you again. In an atempt to understand this concept more clearly, I ran the example which you presented. It worked. I realised that there is something that i am grossly doing wrong. The only difference I can see in your plsql and mine is the kind of data that was selected for update. The modified query is as follows. Thanks again for your prompt reply. July 08, - am UTC. What are the consequences of not specifying the table you want to lock?
August 21, - pm UTC. A reader, August 21, - pm UTC. That definnitely shows the consequences. One more question. If you don't specify the table or the column name in a "select for update" clause, in which order does Oracle acquire the locks first t1, then t2 or first t2, then t1?
If the order is not fixed then this perhaps has consequences in terms of deadlock one session getting it in order t1, t2 and the other getting it in the order t2, t1. Thanx for an awesome site!! Tom Could you kindly comment on the validity of the statement below: From what you told me my conclusions are: 1. You should specify the exact table that you want to lock in your "for update" clause because otherwise you would end up locking all the tables - the order of the locking itself is not important or is atomic - so does not come into play - it is the fact that more locks are acquired than necessary that is of concern.
I don't think the alternative of breaking up into multiple cursors is a good idea - I would instead specify the tables to be locked in a single query. Thanx a million Tom!! The locking order is based on the join order i. If one user ran this query under the RBO, and another user ran this query under the CBO, locking order issues could arise due to the likelihood of a plan difference. August 22, - am UTC. I think the deadlock concerns are way overrated here.
A single query is the right answer. A reader, August 22, - pm UTC. August 24, - am UTC. A little confused reader, August 25, - am UTC. Hi Tom Good day to you. Well I am a little confused, kindly help. As you said "an autonomous transaction is purely a "you are doing it in your session" sort of thing. It does not see any of the uncommitted changes made by the main transaction and does not share any locks or resources with the main transaction. Changes made by an autonomous transaction become visible to other transactions upon commit of the autonomous transactions.
Thanks for all your help. Best Regards. August 25, - am UTC. It would be like trying to pick the cloned sheep daisy out of a herd of sheep. Unless you yourself placed daisy in the herd, you would have no clue which one was she. Hi Tom, With all the respect to you, don't get me wrong I only want to know if autonomous transaction opens another session or uses the same session. I feel it uses same session still we have people with different opinions just wanted to know the right thing.
Thanks as always for your helps It is just like "recursive sql", you've been doing autonomous transactions for years -- you just never knew it.
Dead lock Dillip K. Praharaj, October 22, - pm UTC. October 22, - pm UTC. What did you want it to do? Trust me I would not like to wait. Thanks for the clarification. Tom: We are creating an web application. Now, question is: When more than one users work on same record, only the first one who selects the record can update it. The rest of users are view only for this record. Does Oracle has such function? Do you have any other solutions? Thank you for your helps.
November 07, - am UTC. This software does not use sequences to generate unique numbers for their tables. So, then two sessions might return the same value Is there a more robust way to do this? May 26, - am UTC. Do we have to raise an error? An error would stop all the processing The caller will FAIL anyway. You'll have moved the error elsewhere. Do you really have code that is expected to call this with an undefined sequence value???? All legitimate Oracle experts publish their Oracle qualifications.
Oracle technology is changing and we strive to update our BC Oracle support information. If you find an error or have a suggestion for improving our content, we would appreciate your feedback. Just e-mail: and include the URL for the page. Oracle doesn't bind any limitation to the content of your query. So even though there exists another thread modifying the content of the table and commit it which greatly affects your query result at that time, Because there're not locks, your query result may be outdated.
If for update is added, Oracle will monitor thoese rows being modified, blocking other threads to fire select statement. For update and for update nowait will both lock the rows fulfiling the where statements. In practice, for update or for update nowait is doing the query with lock.
Configuring Persistent Optimizer Statistics Parameters. Configuring the Merge Threshold for Index Pages. InnoDB Table Compression. Overview of Table Compression. Creating Compressed Tables. InnoDB Page Compression. Defragmenting a Table. Online DDL Operations. Online DDL Limitations. Using the Compression Information Schema Tables. Enabling InnoDB Monitors. InnoDB Backup and Recovery. Benefits of the InnoDB memcached Plugin. InnoDB memcached Architecture. InnoDB memcached Plugin Internals.
Troubleshooting the InnoDB memcached Plugin. Troubleshooting Recovery Failures. Forcing InnoDB Recovery. InnoDB Restrictions and Limitations.
0コメント