Skip to content
Snippets Groups Projects
Commit 49b2e88a authored by brinn's avatar brinn
Browse files

fix: sporadic errors where the result set cache doesn't contain a key it is supposed to contain

SVN: 14610
parent 938c3ee8
No related branches found
No related tags found
No related merge requests found
......@@ -330,15 +330,16 @@ public final class CachedResultSetManager<K> implements IResultSetManager<K>, Se
if (mode == ResultSetFetchMode.COMPUTE_AND_CACHE
|| mode == ResultSetFetchMode.CLEAR_COMPUTE_AND_CACHE)
{
K dataKey = resultSetKeyProvider.createKey();
debug("retrieving the data with a new key " + dataKey);
List<T> rows = dataProvider.getOriginalData();
return calculateResult(sessionToken, resultConfig, dataKey, rows);
return calculateResultSetAndSave(sessionToken, resultConfig, dataProvider);
} else
{
K dataKey = cacheConfig.tryGetResultSetKey();
GridRowModels<T> data = fetchCachedData(dataKey);
if (data == null) // Really shoudn't happen, but these cases have been observed.
{
return calculateResultSetAndSave(sessionToken, resultConfig, dataProvider);
}
if (mode == ResultSetFetchMode.FETCH_FROM_CACHE)
{
return filterLimitAndSort(resultConfig, data, dataKey);
......@@ -353,6 +354,15 @@ public final class CachedResultSetManager<K> implements IResultSetManager<K>, Se
}
}
private <T> IResultSet<K, T> calculateResultSetAndSave(final String sessionToken,
final IResultSetConfig<K, T> resultConfig, final IOriginalDataProvider<T> dataProvider)
{
K dataKey = resultSetKeyProvider.createKey();
debug("retrieving the data with a new key " + dataKey);
List<T> rows = dataProvider.getOriginalData();
return calculateResult(sessionToken, resultConfig, dataKey, rows);
}
private <T> IResultSet<K, T> calculateResult(final String sessionToken,
final IResultSetConfig<K, T> resultConfig, K dataKey, List<T> rows)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment