Sometimes we need to check the status of datacontrol transaction, when we have any form or table on the page, initially transaction is not dirty (it means there are no pending changes in the binding layer)
If the user changes any data set on the page that is populated from ADF binding layer, the status of the transaction is modified as now there are pending changes on the page.
When the user performs commit or rollback operation then again transaction status changes.
So it is necessary to have the basic understanding of Transaction Status and using this we can write some better piece of codes.
Example- suppose we have a save button in our Application that performs commit operation when the user clicks on that button, every time commit gets executed but logically if there is no change in the binding layer then commit must not be executed.
So we can check transaction status on this button and if there are any pending changes in ADFm binding layer or transaction is dirty only then commit will be executed.
- I have created a sample application to check this, there is departments and location ViewObjects are on the page and a button to check transaction status
- Code to check transaction status-
- Initially see page status there is no pending changes so the transaction is not dirty
- Now I have changed DepartmentName attribute, then clicked on Check Transaction button
- Now when data is committed again status got changed
Cheers 🙂 Happy Learning
I’m an Oracle ACE, Blogger, Reviewer,
Technical Lead working on Oracle ADF