diff --git a/viability/src/org/labkey/viability/ViabilityManager.java b/viability/src/org/labkey/viability/ViabilityManager.java index 870eb5000..364f0946a 100644 --- a/viability/src/org/labkey/viability/ViabilityManager.java +++ b/viability/src/org/labkey/viability/ViabilityManager.java @@ -267,8 +267,9 @@ public static void updateSpecimenAggregates(User user, Container c, @NotNull Ass // Create temp table with specimen aggregate results String shortName = "ViabilitySpecimenAgg_" + protocol.getRowId() + "_" + tempTableCounter.incrementAndGet(); - String tempTableName = schema.getSqlDialect().getGlobalTempTablePrefix() + shortName; - SpecimenAggregateTempTableToken tok = new SpecimenAggregateTempTableToken(tempTableName); + SpecimenAggregateTempTableToken tok = new SpecimenAggregateTempTableToken(shortName); + SQLFragment tempTableName = new SQLFragment(schema.getSqlDialect().getGlobalTempTablePrefix() + shortName); + tempTableName.addTempToken(tok); TempTableTracker tracker = TempTableTracker.track(shortName, tok); CPUTimer t = new CPUTimer("viability.updateSpecimenAggregates");