أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
When I examined the code, this what it looked like public static String doSomething() { String returnVakue = "default value"; try { ResultSet rs = getMyResultSet(); rs.first(); returnValue = rs.getString("my_field"); // Note that Exception happens at times when the ResultSet is empty } catch (Exception e) { throw new Exception(e); } finally { return returnValue; } } While I am aware that it is perfectly OK to have both throws exception and return, wondering if this can cause any kind of leaks in tomcat. And Is there any potential risk with performance. ? Hoowever my caller function stops the execution at this point. Any views on this? Does it affect the GC? EDIT : NOTE : Please share your views whether this can potentially cause tomcat hanging.