Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers 10g (10.1.3.1.0) Part Number B25947-01 |
|
|
View PDF |
If you need to create an entity object based on either of the following:
Synonym that resolves to a remote table over a DBLINK
View with INSTEAD OF
triggers
Then you will encounter the following error if any of its attributes are marked as Refresh on Insert or Refresh on Update:
JBO-26041: Failed to post data to database during "Update" ## Detail 0 ## ORA-22816: unsupported feature with RETURNING clause
The error says it all. These types of schema objects to not support the RETURNING
clause, which by default the entity object uses to more efficiently return the refreshed values in the same database roundtrip in which the INSERT
or UPDATE
operation was executed.
To disable the use of the RETURNING
clause for an entity object of this type, do the following:
Enable a custom entity definition class for the entity object.
In the custom entity definition class, override the createDef()
method to call:
setUseReturningClause(false)
{para}?>
If the Refresh on Insert attribute is the primary key of the entity object, you must identity some other attribute in the entity as an alternate unique key by setting the Unique Key property on it.
At runtime, when you have disabled the use of the RETURNING clause in this way, the entity object implements the Refresh on Insert and Refresh on Update behavior using a separate SELECT statement to retrieve the values to refresh after insert or update as appropriate.