OrdersManager.GetManager() returning stale results

Posted by Community Admin on 04-Aug-2018 22:03

OrdersManager.GetManager() returning stale results

All Replies

Posted by Community Admin on 26-Sep-2013 00:00

The problem is no matter how many times our application ties to access the Orders manager it always returns the same results, regardless of what has happened in the database in the meantime.  Thus immediately after the first call to this service it is stale, and since this is the only approved interface to the database, it better work.    Something seems wrong here if I have to restart the web application just to get an accurate value.

I know Sitefinity is caching as much as possible because of its performance problems, but its actually returning wrong information at this point.

E.G. To recreate the situation create a button that displays the number of customers, you will see the current number of customers.  Then sign up a new user on the website and then click your button again..  the number of customers won't change until you restart the application in IIS.

protected void Button1_Click(object sender, EventArgs e)
     var ordersManager = OrdersManager.GetManager();
     var customers = ordersManager.GetCustomers().ToList();
     Response.Write(customers.Count());

Is there documentation on the behavior of this service?  Is there even a way for me to tell it to invalidate the cache?  Has anyone ever seen this behavior?  Workarounds?

Sitefinity 6.1.4600.0



This thread is closed