Cannot delete user from UserBrowsingManager if they link ONLY to Session Audit table

Description

Log in to system as user GUEST and select OPD; exit window; logout. Log back in as admin and Settings->Users; select guest row and then the Delete button. Indicate OK to the confirmation dialog and you get a message about the account being used somewhere else.

The message one sees is:

[17/May/2023 15:31:06] [admin:admin] WARN - SQL Error: 1451, SQLState: 23000
[17/May/2023 15:31:06] [admin:admin] ERROR - Cannot delete or update a parent row: a foreign key constraint fails (oh.oh_session_audit, CONSTRAINT oh_session_audit_ibfk_1 FOREIGN KEY (SEA_US_ID_A) REFERENCES oh_user (US_ID_A))
[17/May/2023 15:31:06] [admin:admin] INFO - HHH000010: On release of batch it still contained JDBC statements

Environment

None
100% Done
Loading...

Activity

Alessandro Domanico May 31, 2023 at 9:33 PM

We are done with this issue and it’s subtask.

Promoted to a full tasks: to be better described and to to create subtasks by feature/function.

Thanks a lot everyone for the great job!

Alessandro Domanico May 30, 2023 at 12:44 PM

I tested everything and looks good (different users, some with real operations, others only login) and everything works fine.

Only need resolving conflicts in the current PR (because of OP-898 merge)

I also move the OP-1099 to an independent task.

Thanks a lot!

Daniel Lopez May 29, 2023 at 4:09 PM
Edited

Added all the FKs to OH_USER from XXX_CREATED_BY columns. Fortunately, this one was easy as I was able to use MySQL metadata to generate them.
I tested creating the DB from scratch and got no errors or warnings.

Daniel Lopez May 29, 2023 at 2:39 PM

Great!

I’ll add the other FKs to the current PR.

Alessandro Domanico May 29, 2023 at 10:05 AM

Yeah, we will tackle everything in dedicated issues. don’t you mind to enrich the actual PR with other FKs so we can start to test, merge and close these two issue? Thanks!

Done

Details

Assignee

Reporter

Labels

Original estimate

Time tracking

No time logged6h remaining

Components

Fix versions

Priority

Created May 17, 2023 at 7:36 PM
Updated May 31, 2023 at 9:33 PM
Resolved May 31, 2023 at 9:29 PM