Correctly shutting down a websocket handler
by Robin Anil
When a client disconnects, I see that onClose is not being fired. The only
way this seems to be firing if client sents a close frame.
Is there any way to detect disconnection and immediately close all the
opened resources.
Robin
Robin Anil | Software Engineer
1 year, 2 months
Undertow.js and failed MySQL queries keep connection occupied?
by the outsider
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
6 years, 1 month