Hi Jeff (and others),
Rereading this entire thread, which got hijacked somewhere along the way, I read that you would create a simple sample. Did you ever do this? Also, which version of Servoy are you using (asked by Johan, no answer yet). This is important to us.
As for getting support/the time sink creating sample solutions: we do our best trying to reproduce reported issues, but as there can be many factors that play a role, we cannot always reproduce the reported behavior. Therefor, unfortunately, we rely on the person reporting the issue to make a reproducable case.
As for the red flag: up to a certain point I agree with David: when I see a databaseManager.recalculate(…) in code, I wonder what is wrong, because it shouldn’t be necessary to perform recalculations, except for stored calculations and then only in the following scenario: if you require stored values in the database to be the correct value for external access (reporting tools for example) or when you extract their values from the database through databaseManager.getDatasetByQuery(…).
Why? Because in all other scenario’s, as soon as Servoy loads a record, the calcs of the record will recalculate themselves and from the moment onwards that they will keep themselves up to date until the record gets unloaded. When a calc gets fired, it “records” which data is accessed in the calculation up to the point where a value is returned in the calc code. From that moment onwards, the calc “listens” to changes made to the data the previous calculation was dependant on.
So, as long as you are just within a Servoy Client and you don’t show the values of stored calculations using a getDatasetByQuery(…), there is no reason to call databaseManager.recalculate().
The databaseManager.recalculate(…) function is basically just a convenient function to loop over an entire foundset (containing more records that initially cached in the FoundSet), touching each record, which triggers all the stored calcs which update themselves in the database if required.
If you’re in the situation where external insert/updates/deletes occur on data used by Servoy, you shouldn’t call recalculate, but call refreshRecordFromDatabase() (or plugins.rawSQL.flushAllClientsCache(…) depending on how far you want to take it). Off course it would be even better to get that external process to notify Servoy of the dataChange, but that is another story.
Paul