Skip to content

Commit

Permalink
TempTableTracker pattern
Browse files Browse the repository at this point in the history
hold onto the token (not just in a local variable)
  • Loading branch information
labkey-matthewb committed Oct 23, 2024
1 parent 2cf4460 commit 404754a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions viability/src/org/labkey/viability/ViabilityManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 404754a

Please sign in to comment.