2 Replies Latest reply on Apr 20, 2011 4:47 AM by ewid

    Unable to clear tps_user_session


      Environment :

      Service Desk 7.3.1

      Microsoft Windows Server 2008

      SQL Server 2008


      When  I tried to run the script provided this forum shown the error message "The DELETE statement  conflicted with the REFERENCE constraint “fkey$tps_lock_item$session”.  The conflict occurred in database “dbproduction”. Need assistance.

        • 1. Re: Unable to clear tps_user_session

          Hi Ewid,


          Try using this:


          DELETE FROM tps_user_session WHERE tps_deleted = 1


          This should only remove deleted user sessions, meaning that user has closed their browser or console. This will apply to most user sessions if you run this as a daily script on the database.


          Also, as of 7.4 this particular task is handled by Background Services so the database direct method is no longer required.




          • 2. Re: Unable to clear tps_user_session

            Hi Hadyn,


            Thanks for your response.


            The script that you give is the same as provided in this community. 
            To resolve this issue, first I must erase all data in tps_lock_item table that linked with tps_user_session table and followed by running the script as your advice.