title: Catched ActivitiException still gets thrown and breaks application
body: <p>I'm having trouble understanding what is happening and why my loop doesn't continue. I'm creating a dashboard for all open activiti tasks. Now the trouble i am having is when someone closes a task while the dashboard is being created.</p>
  
  <p>The code is like this:</p>
  
  <pre><code>List&lt;Task&gt; approvalTasks = taskQueryApproval.list();
  for (Task task : approvalTasks) {
      try {
          ActivitiApplicationRequest activitiRequest = (ActivitiApplicationRequest) taskService
                  .getVariable(task.getId(), ACTIVITIREQUEST);
          if (!dashboardValues.containsKey(activitiRequest.getGlobalRequestId())) {
              GlobalRequest globalRequest = globalRequestDao
                  .findMinimalGlobalRequestForDashboardBySyscode(activitiRequest.getGlobalRequestId());
              if (globalRequest != null) {
                  DashboardValueObject vo = new DashboardValueObject(globalRequest);
                  vo.setHasApproval(true);
                  dashboardValues.put(activitiRequest.getGlobalRequestId(), vo);
              }
          }
          } catch (ActivitiException ex) {
              LOGGER.debug("Approval already done, skipping activititask");
          }
  }
  </code></pre>
  
  <p>The trouble I'm having is I know when the task doesn't exist Activiti is going to throw an exception, that's why I placed a try-catch inside the for loop. </p>
  
  <p>What I'm expecting is that when the error is catched it just continues with the rest of the list. While debugging I even saw the catch being done. But the loop still breaks and the application stops. With these exceptions :</p>
  
  <pre><code>SEVERE: Error while closing command context org.activiti.engine.ActivitiException: task 203039 doesn't exist
  at org.activiti.engine.impl.cmd.GetTaskVariableCmd.execute(GetTaskVariableCmd.java:55)
  at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
  at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
  
  9-nov-2012 14:45:42 org.activiti.engine.impl.interceptor.CommandContext close
  SEVERE: Error while closing command context
  org.apache.ibatis.exceptions.PersistenceException: 
  ### Error querying database.  Cause: com.atomikos.jdbc.AtomikosSQLException: The transaction has timed out - try increasing the timeout if needed
  ### The error may exist in org/activiti/db/mapping/entity/Task.xml
  ### The error may involve org.activiti.engine.impl.persistence.entity.TaskEntity.selectTask
  ### The error occurred while executing a query
  ### SQL: select * from ACT_RU_TASK where ID_ = ?
  ### Cause: com.atomikos.jdbc.AtomikosSQLException: The transaction has timed out - try increasing the timeout if needed
  at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
  at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:81)
  </code></pre>
  
  <p>What am I doing wrong?</p>