better dispose
This commit is contained in:
parent
254255b3ac
commit
3f5ce27f19
1 changed files with 6 additions and 1 deletions
|
@ -135,6 +135,7 @@ public class AsyncBatchEventSaveStrategy implements EventHandlingStrategy {
|
||||||
SEBServerInit.INIT_LOGGER.info("> Worker Thread {} running", Thread.currentThread());
|
SEBServerInit.INIT_LOGGER.info("> Worker Thread {} running", Thread.currentThread());
|
||||||
|
|
||||||
final Collection<ClientEventRecord> events = new ArrayList<>();
|
final Collection<ClientEventRecord> events = new ArrayList<>();
|
||||||
|
@SuppressWarnings("resource")
|
||||||
final SqlSessionTemplate sqlSessionTemplate = new SqlSessionTemplate(
|
final SqlSessionTemplate sqlSessionTemplate = new SqlSessionTemplate(
|
||||||
this.sqlSessionFactory,
|
this.sqlSessionFactory,
|
||||||
ExecutorType.BATCH);
|
ExecutorType.BATCH);
|
||||||
|
@ -172,7 +173,11 @@ public class AsyncBatchEventSaveStrategy implements EventHandlingStrategy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
sqlSessionTemplate.close();
|
try {
|
||||||
|
sqlSessionTemplate.destroy();
|
||||||
|
} catch (final Exception e) {
|
||||||
|
log.error("Failed to dispose SqlSessionTemplate", e);
|
||||||
|
}
|
||||||
log.debug("Worker Thread {} stopped", Thread.currentThread());
|
log.debug("Worker Thread {} stopped", Thread.currentThread());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue