Refactor resource management, security, and add CRM common service

Co-authored-by: zhijiantianya <zhijiantianya@gmail.com>
This commit is contained in:
Cursor Agent
2025-07-03 09:26:18 +00:00
parent 7cee12c412
commit 8ce4549b16
4 changed files with 63 additions and 8 deletions

View File

@@ -1093,13 +1093,17 @@ public abstract class AbstractEngineConfiguration {
}
public void close() {
if (forceCloseMybatisConnectionPool && dataSource instanceof PooledDataSource) {
/*
* When the datasource is created by a Flowable engine (i.e. it's an instance of PooledDataSource),
* the connection pool needs to be closed when closing the engine.
* Note that calling forceCloseAll() multiple times (as is the case when running with multiple engine) is ok.
*/
((PooledDataSource) dataSource).forceCloseAll();
try {
// 关闭连接池
if (dataSource instanceof PooledDataSource) {
((PooledDataSource) dataSource).forceCloseAll();
}
// 关闭其他资源
if (sqlSessionFactory != null) {
sqlSessionFactory.getConfiguration().getEnvironment().getDataSource().getConnection().close();
}
} catch (Exception e) {
logger.error("Error closing resources", e);
}
}