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 -> strange deadlock error from Perl DBI

strange deadlock error from Perl DBI

From: Peter Young <pyoung_at_wi.mit.edu>
Date: Tue, 12 Oct 1999 17:15:37 -0400
Message-ID: <3803A4F9.9A6D69E8@wi.mit.edu>


Hi,

I am executing a Perl script that performs a bunch of inserts into several different tables via PL/SQL stored procedures. It gets in a deadlock "with itself".

The behavior is intermittent, but once it happens, it continues to happen until I do an insert by hand (or from another, slightly different Perl script) into the table causing the deadlock error.

The offending PL/SQL block is:

DECLARE

    p_chip_type_id chip_type.chip_type_id%type := '';
    p_chip_lot chips.lot_number%type := 'xxx';
    v_chip_ID chips.chip_ID%type;

BEGIN

    select chip_seq.nextval into v_chip_ID from dual;     insert into chips

        (chip_ID, chip_type, lot_number, manuf)     values

        (v_chip_ID, p_chip_type_ID, p_chip_lot, 1);     ...

The insert into chips line causes the deadlock error. I added the commit and lock statements just for kicks, they don't change the behavior. I tried disabling all referential constraints on Chips as well.

Error inserting chip: $@='[Tue Oct 12 13:41:12 1999] upload-test.pl: DBD::Oracle::st execute failed: ORA-04020: deadlock detected while trying to lock object XDB.CHIPS
[Tue Oct 12 13:41:12 1999] upload-test.pl: ORA-06512: at line 16 (DBD ERROR: OCIStmtExecute) at
/usr/local/etc/httpd/cgi-bin/young/peter/upload-test.pl line 881. ', errstr=ORA-04020: deadlock detected while trying to lock object XDB.CHIPS
ORA-06512: at line 16 (DBD ERROR: OCIStmtExecute)

The trace file is below. I find the fact that the session IDs for both transactions are the same especially intriguing.

Any thoughts?

Regards,
Peter

trace:

System:

I am running Oracle 8.0.5.0.0 Enterprise on NT 4.0 servicepack 4, I am accessing the server from Perl DBI 1.13 and DBD::Oracle 1.03 on Solaris 5.6. Received on Tue Oct 12 1999 - 16:15:37 CDT

Original text of this message

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