ADF Edit page changes do not save to database
514256May 23 2006 — edited Jul 15 2006Hi. I'm using JDeveloper 10.1.3, working off the ADF Tutorial to create an edit page that updates a master-detail record. The user selects a record from a list of records in a table called ACTION, which opens an edit page for that record. The user makes changes to the record and clicks a Save button that uses mergeEntity(Object) to update the database:
<methodAction id="mergeEntity" InstanceName="SessionEJBLocal.dataProvider"
DataControl="SessionEJBLocal" MethodName="mergeEntity"
RequiresUpdateModel="true" Action="999"
ReturnName="SessionEJBLocal.methodResults.SessionEJBLocal_dataProvider_mergeEntity_result">
<NamedData NDName="entity"
NDValue="${bindings.findActionByActionIdIter.currentRow.dataProvider}"
NDType="java.lang.Object"/>
</methodAction>
After hitting the button, the user is taken back to the full list of records. The full list shows the changes that were just made, BUT the changes are not saved to the database. If I open SQL*Plus and run a query the changes are not there. If I re-start the ADF application, the changes are not there.
The following code in SessionEJBLocal.java successfully completes and does not throw exceptions. The entity in the unit of work has the proper updated values:
public Object mergeEntity(Object entity)
{
UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
Object workingCopy = uow.readObject(entity);
if (workingCopy == null)
throw new RuntimeException("Could not find entity to update");
uow.deepMergeClone(entity);
uow.commit();
return workingCopy;
}
Any ideas? Do I need to create a separate commit button? I don't see anything like that in the tutorial...
Trevor