Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] non-repeatable read in combination with a delete



I have a question about a non-repeatable read scenario whereby a parent entity is deleted.


See the enclosed testcase.


The following scenario:


We have 2 entities with a parent-child relationship, Company-Employee.
Suppose the parent is removed in one thread wile another thread inserts a child for the same parent.
It appears that different things happen according to timing issues.


It appears that when the parent is removed (commit) just after it has been found but just before it is registered then the parent will be inserted as a new object with the same primary key.

See testcase “testWR”.

When the parent is removed after it has been registered an ORA-02291 (parent key not found) will occur.

See testcase “testWR2”


The testcases are single threaded but illustrate the point.


I have tested this with Eclipselink 1.1.4, 1.1.2, 1.1.1 and 1.2.0.



I would expect the ORA-02291 to occur in both cases?

What can I do to get a consistent error in both cases?


Met vriendelijke groet,

Huub Sepers

Software Engineer


Attachment: EclipseLinkTest.rar
Description: EclipseLinkTest.rar

Back to the top