Skip to content

Commit fd4317a

Browse files
committed
Clean up MCC table caching
1 parent b64c554 commit fd4317a

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

mcc/src/org/labkey/mcc/query/TriggerHelper.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,16 +281,14 @@ public void possiblySendRabNotification(int reviewerId)
281281
}
282282
}
283283

284-
private TableInfo _mappingTable = null;
285-
286284
private TableInfo getMappingTable()
287285
{
288-
if (_mappingTable == null)
286+
if (_animalMapping == null)
289287
{
290-
_mappingTable = QueryService.get().getUserSchema(_user, _container, MccSchema.NAME).getTable(MccSchema.TABLE_ANIMAL_MAPPING);
288+
_animalMapping = QueryService.get().getUserSchema(_user, _container, MccSchema.NAME).getTable(MccSchema.TABLE_ANIMAL_MAPPING);
291289
}
292290

293-
return _mappingTable;
291+
return _animalMapping;
294292
}
295293

296294
public @Nullable String getMccAlias(String id) {
@@ -299,6 +297,8 @@ private TableInfo getMappingTable()
299297

300298
public int ensureMccAliasExists(Collection<String> rawIds, Map<Object, Object> existingAliases)
301299
{
300+
clearCachedTables();
301+
302302
// NOTE: The incoming object can convert numeric IDs from strings to int, so manually convert:
303303
// Also, CaseInsensitiveSet will convert the keys to lowercase, which is problematic for case-sensitive databases
304304
final CaseInsensitiveHashMap<String> idMap = new CaseInsensitiveHashMap<>();
@@ -391,4 +391,9 @@ public void updateDemographicsColony(String Id, String destination) throws Excep
391391
throw bve;
392392
}
393393
}
394+
395+
public void clearCachedTables()
396+
{
397+
_animalMapping = null;
398+
}
394399
}

0 commit comments

Comments
 (0)