1

My ASP.NET MVC application uses a data structure that is time costly to create, so we are sharing it's instans through the requests. Now, to store changes in this data we need to know, when the seesion is end, or the service shuts down.

Is there any better way then just use Finalyser?

Oleg Oshkoderov
  • 500
  • 1
  • 4
  • 17
  • What do you mean by "sharing its instance through the requests", do you mean you make it static? If you're sharing data using static, it probably shouldn't eve be updated, because the data is obviously shared between users. – Erik Funkenbusch Oct 20 '12 at 21:09

1 Answers1

2

Take a look at When is Session_End() called in ASP.NET MVC?

You can use an in process session and put the Session_End function in your global.asax

Community
  • 1
  • 1
Laurence
  • 1,673
  • 11
  • 16