AnsweredAssumed Answered

selectTaskByQueryCriteria returns null

Question asked by aseem on Sep 24, 2015
Latest reply on Sep 30, 2015 by aseem
activiti-engine version - 5.17.0
Hi,

With the following call to taskService,


org.activiti.engine.task.Task task = taskService.createTaskQuery()
                .taskTenantId("tenantId")
                .taskId("1630666")
                .singleResult();


the resultant task is being returned as null.

org.apache.ibatis.transaction.managed.ManagedTransaction  - Opening JDBC Connection
org.activiti.engine.impl.persistence.entity.TaskEntity.selectTaskByQueryCriteria  - ooo Using Connection [Transaction-aware proxy for target Connection  from DataSource [org.apache.commons.dbcp.BasicDataSource@4cede921]]
org.activiti.engine.impl.persistence.entity.TaskEntity.selectTaskByQueryCriteria  - ==>  Preparing: select distinct RES.* from ACT_RU_TASK RES WHERE RES.ID_ = ? and RES.TENANT_ID_ = ? order by RES.ID_ asc LIMIT ? OFFSET ?
org.activiti.engine.impl.persistence.entity.TaskEntity.selectTaskByQueryCriteria  - ==> Parameters: 1630666(String), tenantId(String), 2147483647(Integer), 0(Integer)
org.activiti.engine.impl.persistence.entity.TaskEntity.selectTaskByQueryCriteria  - <==      Total: 0
org.activiti.engine.impl.db.DbSqlSession  - flush summary: 0 insert, 0 update, 0 delete.
org.activiti.engine.impl.db.DbSqlSession  - now executing flush…
org.apache.ibatis.transaction.managed.ManagedTransaction  - Closing JDBC Connection [Transaction-aware proxy for target Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@67b2ccc4]]
org.activiti.engine.impl.interceptor.LogInterceptor  - — TaskQueryImpl finished ——

If I run the same query directly on mysql db, I get the expected row in the resultset. I know this might not be enough information, but just wished to know if anyone else has seen this problem before. Is it related to some cache not being refreshed and trying to read stale data or something?

Outcomes