Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Data in a form gets replaced after save/commit.

PamelaJan 10 2023

JDeveloper version 11.1.2.4.0
I have a bug that only happens sometimes and requires the user to be inactive for a while.
Have a master detail relationship Customers that have Users and I have a view link between the CustomersView and the UsersView.
Have two pages UsersList page and UserForm page. Both pages are using the same view (Read only table and editable form).
I create a user using the following method from the UserList page which navigates to the form page to edit the newly created record:
public String createUser() {
DCIteratorBinding iter = ADFUtils.findIterator("UsersView1Iterator");
newGuiUser = guiUsersIterator.getRowSetIterator().createRow();
newUser.setAttribute("Loginpwd", randomString(6));
iter.getRowSetIterator().insertRow(newUser);
return "edit_user_details";
}
Everything is fine in the application my form page looks normal and I fill in the data I want in the form (first name: test, last name: test etc..). I save it and I see that in the database everything is correct. I leave the page and after 5-10 minutes I return to the page and I modify the same user record and save (commit) again.
<af:inputText value="#{bindings.LastName.inputValue}" .../> normal form with bindings.
After my second save sometimes the record isn't saved and the form gets refreshed but this time it edits the first record in the UsersView.
My page looks like this before the save:
Username: z1234 Password: z1234 Last Name: Peterson
I modify the Last Name for example to "Test" and hit save.
I see the form being refreshed and all the fields are updated with the data of the first row in the UsersView:
Username: 123 Password: 123 Last Name: Alison
And my modification isn't saved.
My save() method has a catch for all exceptions but there is no error in the log.
I think the save method wasn't called at all.
Then what happens in most cases I have seen is users saving again and then the data of the edited user has been overwritten by the data of the first user in the view and its becomes like a copy but the initial data gets lost.
My guess is something is happening because of passivation/activation but I am not sure about that.

Comments
Post Details