Commit dd66ed3b by fukai

完善数据库连接释放

parent d57feb91
......@@ -140,7 +140,10 @@ public abstract class AbstractCommonController {
ret = ResultUtil.result(ErrorCodes.ERROR, "hander error", e.getMessage());
} finally {
if (context != null)
{
context.getSupport().disconnect();
context.dispose();
}
}
return ret;
......
......@@ -44,7 +44,7 @@ public class LoginController {
@RequestMapping(value = "/login", method = RequestMethod.POST)
public Object login(@RequestBody Map<String, Object> dataMap, HttpServletRequest request, HttpSession session) {
// TODO???
System.out.println(dataMap);
//System.out.println(dataMap);
NoUiRequest noUiRequest = new NoUiRequest(request, "", dataMap);
Map<String, Object> map = new HashMap<String, Object>();
String userId = noUiRequest.getDataMap().get(Constants.USERNAME).toString();
......@@ -86,7 +86,15 @@ public class LoginController {
}
} catch (Exception e) {
log.error("Login command error", e);
throw new NoUiException("Login command error", e);
//throw new NoUiException("Login command error", e);
return ResultUtil.result(ErrorCodes.ERROR, "login failed with exception", null);
}
finally{
if (context != null)
{
context.getSupport().disconnect();
context.dispose();
}
}
log.debug("Login command is finished");
return ResultUtil.result(ErrorCodes.ERROR, "login failed", null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment