Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: DBMS_LOCK.ALLOCATE_UNIQUE and lockhandle

Re: DBMS_LOCK.ALLOCATE_UNIQUE and lockhandle

From: Joseph D. Sumalbag <joseph_sumalbag_at_bose.com>
Date: 1997/11/17
Message-ID: <3470BF94.3AE2@bose.com>#1/1

This is a part of the code that is found in ALLOCATE_UNIQUE stored procedure .

lockhandle := to_char(lockid)||to_char(lockid)||to_char(lockid mod 239)

lockid is really the sequence DBMS_LOCK_ID which is selected by DBMS_LOCK.ALLOCATE_UNIQUE . The reason why I know this is because I had a problem with these user defined locking scheme that Oracle is using .

They do not have a solution to the problem I had but they documented it for review .

I'm running Oracle version 7.2.2.3 and my application is using this procedure . This same problem also exists on Oracle version 7.3 , I know because I tested it in another of our database.... You have to be very careful in using this scheme , specially if you intend to deploy your application on a very very busy system such as my application.

I hope this helps !
Good luck ..... !

Francis Small wrote:
>
> Oracle7 Server Release 7.3.3.0.0:
>
> When making a call to:
>
> DBMS_LOCK.ALLOCATE_UNIQUE(lockname_in, lockhandle_out, expiration_in)
>
> It appears that the first 10 characters of lockhandle_out always equal the
> lockid in the DBMS_LOCK_ALLOCATED table for the corresponding user lock. Is
> this true and can I depend upon this behavior, or should I play it safe and
> simply read the lockid from the table for the corresponding lockhandle? I
> want to use the lockid as an index into a PL/SQL table with the assurance
> that I will not use the same index for two different user allocated locks.
>
> Francis Small
>
> --
> . . . . . . . . . | 1 . . . . . . . . . 2 . . . . . . . . . 3 . . . . . . . .
> Giants Francis Small - M/S M3RA
> Bums Hewlett-Packard Company
> Rockies Microwave Instruments Div.
> Padres 1212 Valley House Dr.
> Rohnert Park CA, 94928
> 707 794 3305
> fthes_at_sr.hp.com
> ***************** Final 1997 National League West Standings *****************

-- 
================================================================
============================
| Joseph Sumalbag                                                                           
|
| Oracle DBA                                                                                
|
|                                                                                           
|
| The opinions expressed above are my own and doesn't 
 necessarily                           |
|reflect the opinion of any of my client company or my employer.                            
|
================================================================
============================
Received on Mon Nov 17 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US