Buggy code:
@ Autowired private TaskLinkService linkService ; @ Autowired private CommentsRepository commRepo ; @ RequestMapping ( value = "task//create" , method = RequestMethod . GET ) public TaskForm startTaskCreate ( Model model ) { } @ Transactional @ RequestMapping ( value = "task//updatelogs" , method = RequestMethod . GET ) public String update ( RedirectAttributes ra , HttpServletRequest request , Model model ) { } @ RequestMapping ( value = "task//create" , method = RequestMethod . POST ) public String createTask ( @ Valid @ ModelAttribute ( "taskForm" ) TaskForm taskForm , Errors errors , RedirectAttributes ra , HttpServletRequest request , Model model ) { } @ Transactional @ RequestMapping ( value = "//task//edit" , method = RequestMethod . GET ) public TaskForm startEditTask ( @ RequestParam ( "id" ) String id , Model model ) { } @ Transactional @ RequestMapping ( value = "//task//edit" , method = RequestMethod . POST ) public String editTask ( @ Valid @ ModelAttribute ( "taskForm" ) TaskForm taskForm , Errors errors , RedirectAttributes ra , HttpServletRequest request ) { } @ Transactional @ RequestMapping ( value = "subtask" , method = RequestMethod . GET ) public String showSubTaskDetails ( @ RequestParam ( "id" ) String id , Model model , RedirectAttributes ra ) { } @ Transactional @ RequestMapping ( value = "task" , method = RequestMethod . GET ) public String showTaskDetails ( @ RequestParam ( "id" ) String id , Model model , RedirectAttributes ra ) { } @ Transactional @ RequestMapping ( value = "tasks" , method = RequestMethod . GET ) public String listTasks ( @ RequestParam ( value = "projectID" , required = false ) String projId , @ RequestParam ( value = "state" , required = false ) String state , @ RequestParam ( value = "query" , required = false ) String query , @ RequestParam ( value = "priority" , required = false ) String priority , Model model ) { } @ RequestMapping ( value = "task//{id}//subtask" , method = RequestMethod . GET ) public TaskForm startSubTaskCreate ( @ PathVariable String id , Model model ) { } @ Transactional @ RequestMapping ( value = "task//{id}//subtask" , method = RequestMethod . POST ) public String createSubTask ( @ PathVariable String id , @ Valid @ ModelAttribute ( "taskForm" ) TaskForm taskForm , Errors errors , RedirectAttributes ra , HttpServletRequest request , Model model ) { } @ RequestMapping ( value = "logwork" , method = RequestMethod . POST ) public String logWork ( @ RequestParam ( "taskID" ) String taskID , @ RequestParam ( "loggedWork" ) String loggedWork , @ RequestParam ( value = "remaining" , required = false ) String remainingTxt , @ RequestParam ( "date_logged" ) String dateLogged , @ RequestParam ( "time_logged" ) String timeLogged , RedirectAttributes ra , HttpServletRequest request , Model model ) { } @ Transactional @ RequestMapping ( value = "//task//state" , method = RequestMethod . POST ) public String changeState ( @ RequestParam ( "taskID" ) String taskID , @ RequestParam ( "state" ) TaskState state , @ RequestParam ( value = "zero_checkbox" , required = false ) Boolean remainingZero , @ RequestParam ( value = "message" , required = false ) String message , RedirectAttributes ra , HttpServletRequest request ) { } @ Transactional @ RequestMapping ( value = "//task//changeState" , method = RequestMethod . POST ) @ ResponseBody public ResultData changeStatePOST ( @ RequestParam ( "id" ) String taskID , @ RequestParam ( "state" ) TaskState state , @ RequestParam ( value = "zero_checkbox" , required = false ) Boolean remainingZero , @ RequestParam ( value = "message" , required = false ) String message ) { } @ RequestMapping ( value = "//task//time" , method = RequestMethod . GET ) public String handleTimer ( @ RequestParam ( "id" ) String taskID , @ RequestParam ( "action" ) String action , RedirectAttributes ra , HttpServletRequest request ) { Utils . setHttpRequest ( request ) ; Task task = taskSrv . findById ( taskID ) ; if ( task != null ) { if ( ( ! ( projectSrv . canEdit ( task . getProject ( ) ) ) ) && ( ! ( Roles . isUser ( ) ) ) ) { MessageHelper . addErrorAttribute ( ra , msg . getMessage ( "error.accesRights" , null , Utils . getCurrentLocale ( ) ) ) ; return "redirect:" + ( request . getHeader ( "Referer" ) ) ; } if ( action . equals ( TaskController . START ) ) { Account account = Utils . getCurrentAccount ( ) ; if ( ( ( ( account . getActive_task ( ) ) != null ) && ( ( account . getActive_task ( ) . length ) > 0 ) ) && ( ! ( "" . equals ( account . getActive_task ( ) [ 0 ] ) ) ) ) { MessageHelper . addWarningAttribute ( ra , msg . getMessage ( "task.stopTime.warning" , new Object [ ] { account . getActive_task ( ) [ 0 ] } , Utils . getCurrentLocale ( ) ) ) ; return "redirect:" + ( request . getHeader ( "Referer" ) ) ; } <START_BUG> account . startTimerOnTask ( taskID ) ; <END_BUG> accSrv . update ( account ) ; if ( task . getState ( ) . equals ( TO_DO ) ) { task . setState ( ONGOING ) ; taskSrv . save ( task ) ; } } else if ( action . equals ( TaskController . STOP ) ) { Period logWork = stopTimer ( task ) ; MessageHelper . addSuccessAttribute ( ra , msg . getMessage ( "task.logWork.logged" , new Object [ ] { PeriodHelper . outFormat ( logWork ) , task . getId ( ) } , Utils . getCurrentLocale ( ) ) ) ; } } else { return "redirect:" + ( request . getHeader ( "Referer" ) ) ; } return "redirect:" + ( request . getHeader ( "Referer" ) ) ;

Fix:
account . startTimerOnTask ( task ) ;