mysql - SQL Query Returning Deleted Rows -
i have following table in database, stated data in it:
support_user_roles table:
user_id | role_id 1 | 1 1 | 2 2 | 2 *2* | *1*
the bottom row, notated '*' has been deleted , in sql developer there no sign of it.
i running following query:
select su.user_id , su.username , sur.role_id , sr.role_name support_users su , support_users_roles sur , support_roles sr su.user_id = sur.user_id , su.is_active != ‘n’ , sr.role_id = sur.role_id , sr.is_active != ‘n’
and returning following:
{ (user_id : 1, role_id : 1), (user_id : 1, role_id : 2), (user_id : 2, role_id : 1), (user_id : 2, role_id : 2) }
as can see, still giving me:
(user_id : 2, role_id : 1)
even though doesn't exist anywhere anymore.
i using java, jsf, primefaces, sql developer, hibernate, weblogic , eclipse ide. i'm not sure if i'm massively missing here , need refresh/update somewhere.
i haven't had before i'm massively confused @ moment :s
any appreciated!
putting comment answer after knowing issue
please make sure use commit
same connection program ran delete
statement. deleting application , commiting on sql developer not work.
right can 1 of 2 things
(1) change code , run commit
once , make sure use commit
after every dml statement
.
(2) use delete
, commit
together. if data deleted
, wont deleted again , commit
happen after that. if not deleted, if deleted , committed.
Comments
Post a Comment