doDML or prepareForDml method in an ADF BC Entity to do some additional work just before posting changes to the database. The official documentation even describes this extension point as being an equivalent to the Oracle Forms Post Processing triggers.Today I discovered this can lead to locking issues in the database when this additional work changes other view objects or entities. The investigation is based on JDeveloper version 11.1.1.7 and this behavior might differ for other versions.
Update Nov 14: The issue doesn't reproduce in ADF 12.1.2.0. Inspecting of the source code seems to indicate (unpublished) bug 11896369 is to blame. Currently working with Oracle support to further investigate and ask for fix backport to 11.1.1.7
Update Jan 2: Oracle development acknowledged this behavior is caused by bug 11896369 and a backport request has been filed to bring the fix to 11.1.1.7.
Update Jan 10: Patch 11896369 is now available for download.
Let's start with an simplified example of an entity mutation another one. Below is the
doDML method of the Department entity. Whenever a change happens to a department it sets the commission of its first employee to 99%. Not a very likely business scenario, but enough to demonstrate the issue.@Override
protected void doDML(int i, TransactionEvent transactionEvent) {
RowIterator employees = getEmployees();
EmployeeImpl firstEmployee = (EmployeeImpl)employees.first();
try {
firstEmployee.setCommissionPct(new Number(0.99));
} catch (SQLException e) {
throw new JboException(e);
}
super.doDML(i, transactionEvent);
}
What we also need is a entity level validation on Employee that will be violated by this change. For demonstration purposes I've setup a range validation for CommissionPct to be between 0.00 and 0.50:
![]() |
| Entity-level Validation Rule |
Now let's build a very simple ADF page to change a department and try to save the changes to the database. Here is what happens:
![]() |
| Validation Error in ADF Application |
Everything appears to be okay. The user is confronted with the validation error as expected. But now let's try to update the same record from a different database session:
![]() |
| Database record locked after validation exception |






