JDeveloper and ADF
Hi I am trying to find a solution to the following issue we are having. When multiple users have accessed the same data the following scenarios are being encountered, 1. User1 deletes a certain record, which is still available to user2. User2 invokes an update on the deleted record and an update page is rendered, but with data from the record after the deleted record in the list. My question, How can we manage this scenario? I have 2 thoughts; 1. Prior to rendering the update page, do a query with the PK to ensure that the record still exists. 2. Allow the user to continue with the update and on commiting the changes to the database, throw an exception "Record does not exists". A further requirement is to ensure that the correct record's data is populated on the update page. 2. The same issue would be if user1 updated his record committed and user2 also updated and committed, possibly overwriting user1's changes. Any help would be appreciated as this is our first Java project. Kind Regards. Leon.
Leon, If you use ADF Business Components for your model layer, scenario #2 will happen by default with no additional code from you. This is known as the "lost update" problem, and ADF BC handles it properly with optimistic locking. John
We are using EJB 3.0 on an Oracle 10g database. I think that the crux of my problem is to ensure that the data the users selects to be edited is actually rendered to the update page. Somehow between the selection of the record and the rendering of the update page the managed bean is re-built and the the selected row data index now points to the record below the record the user wants to edit.