You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the ibmdb I can configure the query timeout in the statement.
How to do this using the Loopback Model? It's possible?
Example using only IBMDB
constibmdb=require("ibm_db");constSQL_ATTR_QUERY_TIMEOUT=ibmdb.SQL_ATTR_QUERY_TIMEOUT;constDB2_QUERY_TIMEOUT=3;// 3 secondsconstinit=async()=>{letDB_CONNECTION=process.env.DB_CONNECTION||'DATABASE=testdb;HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;UID=DB_USERNAME;PWD=DB_PASSWORD';letconnection=ibmdb.openSync(DB_CONNECTION);letsql="update SCHEMA.TABLE set COLUMN1 = 'VALUE' where ID = 1";letstmt=awaitprepareStatement(connection,sql);executeStatement(stmt);}constprepareStatement=(conn,sql)=>{returnnewPromise((resolve,reject)=>{conn.prepare(sql,(err,stmt)=>{if(err)reject(err);elseresolve(stmt);})});}constexecuteStatement=(statement,values)=>{statement.setAttr(SQL_ATTR_QUERY_TIMEOUT,DB2_QUERY_TIMEOUT,(err,result)=>{statement.execute(values,function(err,result){// return });});}init();
When I use the ibmdb I can configure the query timeout in the statement.
How to do this using the Loopback Model? It's possible?
Example using only IBMDB
Example using Lookback Model
The text was updated successfully, but these errors were encountered: