druid (middle-ware)

druid (middle-ware)_第1张图片
image.png

java.sql.Connection lifecycle?

creation, preparation, commit/rollback, close(关闭物理连接)

middle-ware层, 实现 javax.sql.DataSource
向外提供被包装的java.sql.Connection, 比如 DruidPooledConnection

mybatis层
sqlSession
executor
connection.close() 仅仅是逻辑上的关闭, 仅仅是将DruidPooledConnection还给连接池, 并不会关闭底层的物理连接的java.sql.Connection

你可能感兴趣的:(druid (middle-ware))