<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.E-mailStijl17
        {mso-style-type:personal-compose;
        font-family:"Arial",sans-serif;
        color:#1A3E46;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=NL link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>We try to use undertow.js for database interactions and this works well as long as the queries do not fail. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>But in case something breaks, the JDBC connection seems to stall in wildfly and can not be closed in any matter. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>(There isn&#8217;t even a connection.close() statement available in undertow.js ? )<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>Function demo() {<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><b><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:#8DCBE2;background:black;mso-highlight:black'>var</span></b><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:#C7CDD1;background:black;mso-highlight:black'> </span><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:#BED6FF;background:black;mso-highlight:black'>db</span><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:#C7CDD1;background:black;mso-highlight:black'> </span><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:#D8D8D8;background:black;mso-highlight:black'>=</span><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:#C7CDD1;background:black;mso-highlight:black'> </span><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:#D8D8D8;background:black;mso-highlight:black'>$undertow.</span><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:white;background:black;mso-highlight:black'>resolve</span><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:#D8D8D8;background:black;mso-highlight:black'>(</span><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:#FFC600;background:black;mso-highlight:black'>&quot;config&quot;</span><span lang=EN-GB style='font-size:10.0pt;font-family:Consolas;color:#D8D8D8;background:black;mso-highlight:black'>);</span><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>try{<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var query &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &quot;select ID as maxID from null&quot;; // this will fail for sure<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var dbresult &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = db.selectOne(query);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // now undertow.js will jump to the catch() block<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result.db&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = dbresult['maxID'];<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return result; <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }catch(ex){<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print(ex.toString());<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>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. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>This continues until the </span><span lang=EN-GB>Max Pool Size:&nbsp; </span><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#1A3E46'>is reached. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB>Systems tested: Wildfly 10 /11 on Windows and Linux<o:p></o:p></span></p></div></body></html>