dbms_lock question -
03-15-2006
, 07:02 PM
Hello, I am trying to use DBMS_LOCK within an application to prevent two
users from doing a specific task at the same time.
The allocate_unique and request calls work just fine. However, If my
attempt to obtain a lock fails 'cause some other user
has acquired the lock, I want to know who that user is. I see where you can
look in V$LOCK for locks of type 'UL'.
But the "ID1" field maps to an internal value, not the "handle" value
returned by allocate_unique. Since v$lock has the SID value,
I can then look in V$Session for the user attributes. But this won't work
without somehow mapping the "external" handle from allocate_unique to the
"internal" id in v$lock. Any way to do this?
Thanks,
Leor |