.ora-code.com

Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
nowait cursors in triggers

nowait cursors in triggers

2005-06-09       - By Connor McDonald
Reply:     1     2     3     4  

Hi all,

Does anyone know of a restriction (documented or otherwise) that
prohibits triggers from using 'for update nowait' cursors ?

Consider the following example:
-- ---- ---- ---- ---- ---- ----
SQL> create table T ( x number, y number );

Table created.

SQL> insert into T values (1,1);

1 row created.

SQL> insert into T values (2,1);

1 row created.

SQL> create or replace
 2  trigger TRG after delete on T
 3  declare
 4    cursor C is select * from t
 5     where y =3D 1
 6     for update NOWAIT;
 7  begin
 8    open c;
 9  end;
10  /

Trigger created.

Session 1 then does the following:

SQL> set sqlprompt 'SES1> '
SES1> delete from t where x =3D 1;

1 row deleted.

Session 2 then tries to delete a different row, but the
after-statement trigger will then try to
get a nowait lock on both rows:

SQL> set sqlprompt 'SES2> '
SES2> delete from t where x =3D 2;

(waiting....waiting....)

Is this correct behaviour ?  Why does ses2 not get a "ORA-00054 (See ORA-00054.ora-code.com):
resource busy and acquire with NOWAIT specified"

Cheers
Connor

--=20
Connor McDonald
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
email: connor_mcdonald@(protected)
web:   http://www.oracledba.co.uk

"Semper in excremento, sole profundum qui variat"
--
http://www.freelists.org/webpage/oracle-l