There is one not very visible, but quite powerful property available for ADF BC Entity Object attribute. This property is called – Changed Indicator. By default, during commit operation, ADF scans each changed attribute from the current row and compares value in the DB. If it locates changed values in DB, reports error about another user changes in the same row. While this is expected functionality, there are use case when we want to allow commit, even data was changed already by someone else. For example, in more complex systems, data is updated by PL/SQL procedures, we don’t want to inform user with error about this. There is a way to override lock method in EO implementation class, catch lock error and raise lock again. This works, but there is different way – to use Change Indicator. This property defines specific attribute to be responsible for row data changes tracking, instead of checking every attribute. Only if Change Indicator attribute value will be changed in DB, then current row changes will be prevented and user will be informed about someone else changes in the same row.
My previous post – Different Approach for DB Constraint Error Handling in ADF, about handling DB constraint errors is using Change Indicator defined for Primary Key. In this way, I’m completely ignoring changes by other users and allowing to commit data no matter if it was changed by someone else.
Here you can download sample application with Change Indicator demo – ChangeIndicatorApp.zip. Change Indicator can be set on EO attribute, I’m using Department Id in this example. This would mean, all changes are allowed without informing a user about new changes in DB, except when Department Id is changed: Read the complete article here.
For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.