Re: Locking problem - URGENT
Date: 1997/06/24
Message-ID: <33b32d3e.30514958_at_newshost>#1/1
It'll get tricky and you have to manage your savepoint stacks yourself, but you can use a savepoint to do this.
for example, try in one sqlplus session:
SQL> select * from dept where deptno = 10 for update;
SQL> savepoint Hello;
SQL> select * from emp where deptno = 10 for update;
Now, in another window, try:
SQL> select * from dept where deptno = 10 for update nowait; ORA-00054: resource busy and acquire with NOWAIT specified
SQL> select * from emp where deptno = 10 for update nowait; ORA-00054: resource busy and acquire with NOWAIT specified
Back in the first window, issue:
SQL> rollback to savepoint Hello;
And in the second window, try to the 2 sql statement again. You'll find that dept query still blocks but the emp query succeeds. The rollback to savepoint released the locks gained inside the savepoint, but not the ones gained before the savepoint. savepoints work like a stack, you must manage the stack yourself programmatically.
On 22 Jun 1997 19:14:16 GMT, "Krishnan Ranganathan" <kaa_at_criinc.com> wrote:
>Hi ,
>
>I am facing the following problem,a quick response from any one of you
>would be greatly appreciated.
>
>LOCKING PROBLEM IN FORMS 4.5
>I have a form with two multi-record blocks :
>1. Block 1 contains following:
>
> Part Number Description
> P1 xxxxxxxxxxxxxx
>
>When user enter 'P1' at Part Number and press a 'Details' push-button, I
>retrieve all purchase requisitions for the entered part number, and
>transfer control to block-2 which has following fields :
> Purchase Requisition Number Status
> PR1 A
> PR2 A
>PR3 A
>PR4 A
>PR5 A
>
>In 'WHEN-VALIDATE-ITEM' of Part Number field, I lock all the purchase
>requisition records displayed in block-2.
>The user can go back to Part Number field in block-1 , and change entered
>part number from say 'P1' to 'P2'. When the user does this ( changes part
>number from P1 to P2 ), I want to release locks on all the purchase
>requisition records for part P1 that were locked earlier.
>I cannot use 'CLEAR-FORM', 'EXIT-FORM', 'ROLLBACK', 'COMMIT' etc. at this
>stage in my application.
>
>How do I relase the locks. Please forward your answers to kaa_at_criinc.com
>
>Regards
>Krishnan
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Jun 24 1997 - 00:00:00 CEST