Total Pageviews

Search This Blog

Wednesday, January 5, 2011

Object Version Number (OVN) in API

 Object Version Number (OVN) is a column in a database table. It is used to track multiple changes to a record. When a new row is inserted, the OVN is set to 1. As updates are performed on the row through the Forms, the OVN is incremented. The OVN is transferred with a queried row. If an update is attempted when the change is saved to the table, the current OVN is compared with the value being passed back from the transaction. If the two are the same, the update can be committed to the table. If the two are different, the update is rejected and flagged with an error. The transaction must be re-queried, and the update made again to the more current version of the row.

APIs and Forms use OVNs similarly. Every published API has the p_object version_number control parameter.

For Create APIs, this parameter is defined as an OUT parameter: the API assigns the object version number to 1 for row inserts. For Update APIs, the parameter is defined as IN OUT, and is mandatory in the API call.

The current value must be passed in the API call and it is compared to the version on the row in the table. If the versions are different, the error HR_7155_OBJECT_LOCKED is raised. The information can be re-queried for a more current version.




You can use the following query to determine the OVN to pass in your API call:

select max(ovn) from (table name)  where person_id/assignment_id etc=(some value)





Thanks and Regards
Sameer S Patil
"Team Work" More We Less Me.

No comments:

Post a Comment