We try to use undertow.js for database interactions and this works well as long as the queries do not fail.

But in case something breaks, the JDBC connection seems to stall in wildfly and can not be closed in any matter.

(There isn’t even a connection.close() statement available in undertow.js ? )

Function demo() {

var db = $undertow.resolve("config");

try{

                        var query                      = "select ID as maxID from null"; // this will fail for sure

                        var dbresult                   = db.selectOne(query);

                        // now undertow.js will jump to the catch() block

                        result.db                       = dbresult['maxID'];

                        return result;

            }catch(ex){

                        print(ex.toString());

}

}

 

Every time we call the above function the JDBC driver will make a new connection to the database and the old ones will remain connected and will never be cleared.

This continues until the Max Pool Size:  is reached.

 

Systems tested: Wildfly 10 /11 on Windows and Linux