As Per Oracle docs- JBO-27101: Dead Entity Access Exception
Cause: Trying to refer to an invalid/obsolete entity. This could occur if some business logic has held on to an entity reference which was removed and the transaction has been posted or committed. It could also occur if a reference entity has been removed from the cache and any ViewRow is attempting to access it.
Action: Use findByPrimaryKey to find a valid entity of the desired key instead of holding on to a reference to an entity instance.
This exception mainly occurs when developer/User removes a row from ViewObject and try to access it again to set any value or to commit the transaction.
if an entity(object of a row in the table) is removed and then accessed from cache throws this exception
So Always check code that you have written to remove a row from the entity and do check your doDML() method in EntityImpl class as it executes during commit after any DML Operation (Update, Delete).
Steps to reproduce DeadEntityAccessException–
- here I am using default HR Schema (Departments table)
- Create business components using Departments table
- Create a page and drag Departments viewObject from data control as a table on the page and also drop delete and commit operation on page
- Now go to EOImpl class of Departments Entity Object and just set any attribute’s value in doDML(); method
- Now just run your application and delete any row then press commit, in this case, doDML(); method tries to set managerId in the deleted row that is not in the cache, in this case, you will see DeadEntityAccessException
Cheers 🙂 Happy Learning
An Oracle ACE, Blogger, Reviewer, Technical Lead working on Oracle ADF