Description of problem: It's not possible to delete a user who has saved searches objects in the database. Version-Release number of selected component (if applicable): 4.6 How reproducible: Always Steps to Reproduce: 1. Create a user with admin account 2. Logout and login as the new user 3. Create a saved search 4. Logout and re-login as RHQ admin 5. Delete the new user Actual results: The user is not deleted and en error message "Failed to delete user [[xxxxx]]" is shown Expected results: The user is deleted Additional info: Reported by community on forum: https://community.jboss.org/message/808527 Logs: 13:12:13,316 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-0.0.0.0-0.0.0.0-7080-6) SQL Error: 0, SQLState: 23503 13:12:13,317 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-0.0.0.0-0.0.0.0-7080-6) L'élément du batch 0 delete from RHQ_SUBJECT where ID=10001 a été annulé. Appeler getNextException pour en connaître la cause. 13:12:13,318 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-0.0.0.0-0.0.0.0-7080-6) SQL Error: 0, SQLState: 23503 13:12:13,319 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-0.0.0.0-0.0.0.0-7080-6) ERREUR: UPDATE ou DELETE sur la table « rhq_subject » viole la contrainte de clé étrangère « rhq_saved_search_subject_id_fkey » de la table « rhq_saved_search » Détail : La clé (id)=(10001) est toujours référencée à partir de la table « rhq_saved_search ».
Targetting at JON32
Setting to high priority as this is annoying and I hope in theory be relatively easy to fix
Fixed in master 8e62d50 commit 8e62d50b8edd576ca3b53ecb9c198d9df288b35d Author: Thomas Segismont <tsegismo> Date: Thu May 2 12:55:57 2013 +0200 Bug 952652 - Unable to delete a user who has saved searches objects in the database Now deleting saved searches prior to deleting the user. Merged delete methods. Fail fast if caller tries to delete a superuser. Added itest for the BZ
This bz is available for testing with the latest 3.2.x brew build: https://brewweb.devel.redhat.com//buildinfo?buildID=280316
As this is MODIFIED or ON_QA, setting milestone to ER1.
verified