title: Prevent Changes during long running job
body: <p>Our Web Application uses an .net-core web api running on a loab balancer and an angular client. We access the DB using EF core.
  We have a long running background-task that does a great amount of calculation and takes about 2-3 hours to do so, but will only be initiated by administrators of the application 3-4 times a year. 
  While the job is running we want to prevent users from adding/editing/deleting data and our client told us its even fine if the application is not avaliable for the duration as they will mostly do it overnight.
  The easiest way to do this is to redirect users to an informationpage while the job is running but I have found no way of actually getting to the information if the task is running or not. </p>
  
  <ul>
  <li><p>I could set a flag whether the job is running or not and just check that flag at every request but I found no way to access an applicationwide state.</p></li>
  <li><p>I cannot save a flag to the DB because while the transaction is commiting at the end of the job (~1 hour) we cannot read from the DB</p></li>
  </ul>
  
  <p>What baffles me most is that I have not found a single article or question about a problem like that which doesn't seem to be too outlandish to me, so I guess I'm missing something very obvious.</p>