node-jt400
node-jt400 copied to clipboard
Can the pool size (max connections) be defined?
I noticed there's no pool size setting in Pool class. For better performance and more concurrent connections, shouldn't the pool size be defined to allow for idle/available connections?
this.sqlPool = new AS400JDBCConnectionPool(ds);
sqlPool.fill(10);
Hi @teddyngibm
This is a feature we do not use currently at TM. If you would like to have it added, I would be happy to review a pull request from you.
You would have to send the config from the typescript part... something like
export const jt400: Connection = pool({
poolSize: 10
})
And then perhaps set like you suggest:
this.sqlPool = new AS400JDBCConnectionPool(ds);
sqlPool.fill((String) jsonConf.get("poolSize"));
And then make a working test for it.
Hello, How do you resolve the issue at TM, that nothing ends the jobs QZRCSRVS that are started by the node400.js ? After time, there are hundreds of jobs doing nothing on the system. And eventually they will fill up the system table that keeps track of jobs on the system ( WRKSYSVAL QMAXJOB to see the setting for maximum jobs allowed on the system). Unless we can either re-use the same job or end the jobs that are already on the IBM i, this solution will not be able to work on a production server. The pool.Close() only seems to close the QZDASOINIT job, and the QZRCSRVS job on the IBM i that runs the pool.defineProgram is never closed. We have the timeout set on the program, but this does not seem to relate to the pool / job on the IBM i. I do not intend to do a pull request as I am not a Java programmer - we are looking for something to use as an interface and came across this package. I am interested in the answer about how you use this on your systems, when the jobs do not seem to have a way to either end or re-use them. Have we missed something in the documentation ? Thank you