我正在运行以Node.js为后端的dashDB应用程序。我使用ibm_db节点包作为连接到dashDB的驱动程序.Node.js和dashDB部署在IBM中。我不使用ibm_db包提供的连接池选项。我们有后台作业(节点-cron包中的cron作业),它经常查询dashDB的CRUD操作(比如每2分钟一次)。在最初的30分钟里,没有问题。在30-45分钟之后,当我们试图建立一个连接时,我们就开始出现错误。
一旦从数据库中获得结果,我们将打开连接并关闭连接。
下面是我们用来打开和关闭连接的代码:
var dashDB = require("ibm_db")
function openConnection(next) {
try {
dashDB.open(connectionString, function(err, connection) {
if (err) return dashDBError('openConnection', err)
console.log('DB: openConnection.'.blue)
connectionsCount ++
next(connection)
});
} catch(err) {
console.error('CAUGHT OPEN CONNECTION ERROR')
console.log(err)
next({ error: err })
}
}
//Close dashDB connection
function closeConnection(connection) {
connection.close(function(err) {
if (err) return dashDBError('closeConnection', err)
connectionsCount --
console.log('DB: closeConnection.'.blue)
})
}
//Throw error on exception
function dashDBError(action, err) {
console.error('DB ERROR', action, err.message)
console.log('Connections: ', connectionsCount)
console.trace("Here I am!")
return { error: err }
}以下是我们所犯的错误:
**[IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS".
Location where the error was detected: "169.55.227.101". Communication function detecting the error: "send". Protocol specific error code(s): "32", "*", "0". SQLSTATE=08001
[IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS".
Location where the error was detected: "169.55.227.101". Communication function detecting the error: "selectForConnectTimeout". Protocol specific error code(s): "115", "*", "*". SQLSTATE=08001
Assertion failed: (ret != SQL_INVALID_HANDLE), function GetColumnValue, file ../src/odbc.cpp, line 620.
Abort trap: 6** 发布于 2016-09-16 23:09:32
通常,SQL30081N错误是指客户端和服务器之间在tcp/ip层中的通信错误。检查下面的内容。
查看此技术说明,其中详细介绍了db2客户端和服务器连接之间的各种原因以及解决db2错误的方法。
IBM连接错误
如果这没有帮助,请联系db2支持小组进行进一步调查。
smurali_IBM
https://stackoverflow.com/questions/39539324
复制相似问题