dashDB를 백엔드로 사용하여 Node.js 응용 프로그램을 실행 중입니다. 나는 dashDB에 연결하기위한 드라이버로 ibm_db 노드 패키지를 사용합니다. Node.js 및 dashDB는 IBM Bluemix에 배포됩니다. ibm_db 패키지에서 제공하는 연결 풀 옵션을 사용하지 않습니다. 우리는 CRUD 작업을 위해 dashDB를 자주 (2 분마다) 쿼리하는 백그라운드 작업 (노드 -cron 패키지의 cron 작업)을 가지고 있습니다. 처음 30 분 동안 아무런 문제가 없었습니다. 30-45 분이 지나면 연결을 설정하려고 할 때 오류가 발생하기 시작합니다.dashdb : 연결 오류 SQLSTATE = 08001
우리는 데이터베이스에서 결과를 얻자 마자 연결을 열고 연결을 닫습니다.
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**
감사합니다. Murali. Dash DB 지원팀에 문의하고 있습니다. 지원팀에서 문제를 조사하고 있습니다. –