Skip to content

Commit

Permalink
0002763: UI Problems when a row in sym_data has a bad trigger_hist_id
Browse files Browse the repository at this point in the history
  • Loading branch information
mmichalek committed Sep 6, 2016
1 parent 4fe03fb commit 770726d
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -133,7 +133,7 @@ public class TriggerRouterService extends AbstractService implements ITriggerRou
* Cache the history for performance. History never changes and does not
* grow big so this should be OK.
*/
private HashMap<Integer, TriggerHistory> historyMap = new HashMap<Integer, TriggerHistory>();
private Map<Integer, TriggerHistory> historyMap = Collections.synchronizedMap(new HashMap<Integer, TriggerHistory>());

public TriggerRouterService(ISymmetricEngine engine) {
super(engine.getParameterService(), engine.getSymmetricDialect());
Expand Down Expand Up @@ -376,9 +376,11 @@ public List<TriggerHistory> findTriggerHistories(String catalogName, String sche
public TriggerHistory getTriggerHistory(int histId) {
TriggerHistory history = historyMap.get(histId);
if (history == null && histId >= 0) {
history = (TriggerHistory) sqlTemplate.queryForObject(getSql("triggerHistSql"),
history = sqlTemplate.queryForObject(getSql("triggerHistSql"),
new TriggerHistoryMapper(), histId);
historyMap.put(histId, history);
if (history != null) {
historyMap.put(histId, history);
}
}
return history;
}
Expand Down

0 comments on commit 770726d

Please sign in to comment.