Asynchronous Process with DB2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2012 04:44 AM
Hi,
i have a problem with an asynchronous service task.
I built a very simple process..
[attachment=0]process.JPG[/attachment]
..with an asynchronous serviceTask.
The process fails all the time with db2 and throws this exception: :roll:
if I execute the process with h2, it runs without any exceptions..
Can anyone help, please?
ops:
i have a problem with an asynchronous service task.
I built a very simple process..
[attachment=0]process.JPG[/attachment]
..with an asynchronous serviceTask.
The process fails all the time with db2 and throws this exception: :roll:
### Error querying database. Cause: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-401, SQLSTATE=42818, SQLERRMC==, DRIVER=3.59.81### The error may involve org.activiti.engine.impl.persistence.entity.JobEntity.selectExclusiveJobsToExecute-Inline### The error occurred while setting parameters### Cause: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-401, SQLSTATE=42818, SQLERRMC==, DRIVER=3.59.81
if I execute the process with h2, it runs without any exceptions..
Can anyone help, please?

Labels:
- Labels:
-
Archive
process_1.JPG
8 KB
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2012 09:19 AM
I found the problem.
There is a bug in the activiti-engine-5.9.jar/org.activiti.db.mapping.entity/job.xml
This sql tries to compare the EXCLUSIVE_ with "TRUE". But in DB2 "EXCLUSIVE_" is created as a smallint and should be compared with "1" (like oracle)
I fixed the problem by replacing "TRUE" with "1"
There is a bug in the activiti-engine-5.9.jar/org.activiti.db.mapping.entity/job.xml
<select id="selectExclusiveJobsToExecute" parameterType="map" resultMap="jobResultMap">
select *
from ACT_RU_JOB
where (RETRIES_ > 0)
and (DUEDATE_ is null or DUEDATE_ < #{now, jdbcType=TIMESTAMP})
and (LOCK_OWNER_ is null or LOCK_EXP_TIME_ < #{now, jdbcType=TIMESTAMP})
and (RETRIES_ > 0)
and (EXCLUSIVE_ = TRUE)
and (PROCESS_INSTANCE_ID_ = #{pid})
</select>
This sql tries to compare the EXCLUSIVE_ with "TRUE". But in DB2 "EXCLUSIVE_" is created as a smallint and should be compared with "1" (like oracle)
I fixed the problem by replacing "TRUE" with "1"
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2012 05:13 AM
Hi kirek,
Nice catch, would you be willing to attach a patch to ACT-1131 ?
Nice catch, would you be willing to attach a patch to ACT-1131 ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2012 03:00 AM
see more here..
https://jira.codehaus.org/browse/ACT-1131
but only use the attaced file, if you only work with DB2.
The changed Methods are used by every database (excluded oracle), so you cannot
work with other databases anymore.
https://jira.codehaus.org/browse/ACT-1131
but only use the attaced file, if you only work with DB2.
The changed Methods are used by every database (excluded oracle), so you cannot
work with other databases anymore.
