As Per Oracle docs- JBO-27101: DeadEntityAccessException
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 transaction .
if entity(object of a row in table) is removed and then accessed from cache throws this exception
So Always check code that you have written to remove a row from 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 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 try to set managerId in deleted row that is not in cache, in this case you will see DeadEntityAccessException