0

我通常知道错误是否发生,我的意思是org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted,这意味着连接过载。但在这种情况下,我很确定没有连接到我的本地 mysql 服务器(我使用了“show processlist”命令)。

有没有其他地方会导致这个错误?

下面是我的代码:

try {
    // Obtain a connection
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup(jndiSrc);
    _log.info("==============" + jndiSrc + " is bound to " + ds + "=====================");
    return ds.getConnection(); 
}
4

0 回答 0