Consultor Eletrônico



Kbase P3016: CREATE Statement fails with error 4407: RECID was deleted by another user.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Verified

FACT(s) (Environment):

Progress 9.1x

SYMPTOM(s):

Error 4407 during a static or dynamic CREATE statement

Error 4407 within a CREATE trigger

Error 4407 to a newly created record

<table-name> RECID <RECID> was deleted by another user. (4407)

CAUSE:

Bug# 20020827-001

CAUSE:

Occurs on the client during a CREATE statement (static or dynamic). If the newly created record has the same ROWID as a record from the same table currently held in another buffer, Progress detects the conflict and generates error 4407.
Error 4407 can only occur when the record in the other buffer was read with NO-LOCK and another user deleted it.

The following code may reproduce the problem:
/* firstSession.p */
DEFINE BUFFER bCust FOR customer.

FIND LAST bCust NO-LOCK.
PAUSE MESSAGE "Waiting for record to be deleted".
DO TRANSACTION:
CREATE customer.
ASSIGN customer.name = "Whatever".
END.

/* secondSession.p */
DO TRANSACTION:
FIND LAST customer EXCLUSIVE-LOCK.
DELETE customer.
END.

1) Run firstSession.p on a 4GL client session and, while firstSession.p is pausing, run secondSession.p on another 4GL client session.
The status now is that buffer bCust in firstSession.p is holding in memory a copy of a record that does not exist any longer in the database.

2) Press the space bar in the first session.
If the new customer record happens to reuse the ROWID that was assigned to the record in buffer bCust, error 4407 is generated.

3) A side effect of error 4407 is that buffer bCust will be deleted from memory, and will no longer be AVAILABLE.


FIX:

Upgrade to Progress version 9.1E or 10.0A and up.