我应该在成功回调后关闭 oracle 连接吗?
Should i close oracle connection after success callback?
我正在使用 oracledb 在我的 nodejs 应用程序中获取新的 oracle 连接,但我注意到在 v$session
table 中记录了许多 connections/sessions,如 'INACTIVE'。
当我遇到错误时,我的应用程序总是会释放与 this.doReleaseConn(conn, !autoCommit);
的连接,但我不确定是否应该使用这种处理方式以及成功回调。
来自node-oracledb Connection Pooling doc:
Connections must be released with connection.close() when no longer needed so they can be reused. Make sure to release connections in all codes paths, include error handlers.
关于连接池的要点是 Node.js 层和数据库之间的连接保持打开状态并准备好快速重用。所以您将在 V$ 视图中看到这方面的证据。
我正在使用 oracledb 在我的 nodejs 应用程序中获取新的 oracle 连接,但我注意到在 v$session
table 中记录了许多 connections/sessions,如 'INACTIVE'。
当我遇到错误时,我的应用程序总是会释放与 this.doReleaseConn(conn, !autoCommit);
的连接,但我不确定是否应该使用这种处理方式以及成功回调。
来自node-oracledb Connection Pooling doc:
Connections must be released with connection.close() when no longer needed so they can be reused. Make sure to release connections in all codes paths, include error handlers.
关于连接池的要点是 Node.js 层和数据库之间的连接保持打开状态并准备好快速重用。所以您将在 V$ 视图中看到这方面的证据。