Session Event table not purging

  • Session Event table not purging

    Posted by Jason Wilder on August 7, 2018 at 12:13 pm
    • Jason Wilder

      Member

      August 7, 2018 at 12:13 PM

      We are running NAV 2017.Ā 

      In base NAV there is a Session Events table that logs when someone (or something such as web services) logs in or out of NAV.

      There is a setting on the service tier called “Session Event Table Retention Period” which is supposed to automatically deleted records older than the setting (in months).Ā  All of our service tiers have this set to 3.

      We have over 6 million records in this table with entries going back to almost over a year.Ā  Most of these records come from Web Services and Job Queues not users.

      Anyone else have this issue where the records are not being deleted?Ā  My solution will be to create a job to delete anything older than 7 days but wanted to see if any else has this same issue.

      ——————————
      Jason Wilder
      Senior Application Developer
      Stonewall Kitchen
      York ME
      ——————————

    • Michael Heydasch

      Member

      August 8, 2018 at 5:50 AM

      hi Jason,

      I ran into this issue in 2014 (NAV version 2013) due to an add-on; the Session Event table grew to millions of records within months, and the CustomSettings.config parameter you mentioned wasn’t keeping the table clean. Because of the SQL delete table trigger code on [dbo].[Session Event] (installed with NAV), a job that simply deleted records had adverse effects, so I designed a way to bypass the SQL delete table trigger code and still run from the Job Queue.Ā  It’s set to run once every 10 minutes; for each iteration, if the table count is greater than 1M recs, the oldest 10k recs are deleted.Ā  The code is included as an attachment to this message.

      ——————————
      Michael Heydasch
      Solutions Architect
      ArcherPoint Inc.
      Knoxville TN
      ——————————
      ——————————————-

    • Jason Wilder

      Member

      August 13, 2018 at 7:30 AM

      Thanks for the response!

      I did just create a job that deletes records in the session event table via NAV not SQL.Ā  I see the 1 delete trigger (the other is an insert trigger) in SQL and it looks like it isĀ  meant to remove an active session tied to the event if there is one.Ā  ThisĀ  would be pretty unlikely in our database.

      Do you remember the “adverse effects” as I might want to reconsider based on your answer.

      ——————————
      Jason Wilder
      Senior Application Developer
      Stonewall Kitchen
      York ME
      ——————————
      ——————————————-

    Jason Wilder replied 7 years, 11 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Session Event table not purging’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!