
|
If you were logged in you would be able to see more operations.
|
|
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
|
|
Unfortunately when using hibernate 3 with weblogic you have to use hibernate.query.factory_class=org.hibernate.hql.classic.ClassicQueryTranslatorFactory to configure hibernate because of antlr incompatibility between weblogic and hibernate.
That causes the delete timers queries in SchedulerSession to fail with the following exception:
org.hibernate.QueryException: query must begin with SELECT or FROM: delete [delete from org.jbpm.scheduler.exe.Timer where name = :timerName and token = :token]
I had to modify the source code to not use the batch DML for now only in two methods that delete the timers. I'm going to modify the other code like that if we have the same issues as we go.
The following is the code I use:
private static final String deleteTimersQuery =
"from org.jbpm.scheduler.exe.Timer t " +
"where t.name = :timerName" +
" and t.token = :token";
public void cancelTimers(SchedulerInstance.CancelledTimer cancelledTimer) {
try {
Query query = session.createQuery(deleteTimersQuery);
query.setString("timerName", cancelledTimer.getTimerName());
query.setEntity("token", cancelledTimer.getToken());
List timers = query.list();
for (Iterator ti = timers.iterator(); ti.hasNext();) {
Timer timer = (Timer) ti.next();
session.delete(timer);
}
} catch (Exception e) {
log.error(e);
jbpmSession.handleException();
throw new RuntimeException("couldn't delete timers '"+cancelledTimer.getTimerName()+"' on token '"+cancelledTimer.getToken().getId()+"' from the database", e);
}
}
private static final String deleteTimersForProcessInstanceQuery =
"from org.jbpm.scheduler.exe.Timer t " +
"where t.processInstance = :processInstance";
public void cancelTimersForProcessInstance(ProcessInstance processInstance) {
try {
Query query = session.createQuery(deleteTimersForProcessInstanceQuery);
query.setEntity("processInstance", processInstance);
List timers = query.list();
for (Iterator ti = timers.iterator(); ti.hasNext();) {
Timer timer = (Timer) ti.next();
session.delete(timer);
}
} catch (Exception e) {
log.error(e);
jbpmSession.handleException();
throw new RuntimeException("couldn't delete timers for process instance '"+processInstance+"'", e);
}
}
|
|
Description
|
Unfortunately when using hibernate 3 with weblogic you have to use hibernate.query.factory_class=org.hibernate.hql.classic.ClassicQueryTranslatorFactory to configure hibernate because of antlr incompatibility between weblogic and hibernate.
That causes the delete timers queries in SchedulerSession to fail with the following exception:
org.hibernate.QueryException: query must begin with SELECT or FROM: delete [delete from org.jbpm.scheduler.exe.Timer where name = :timerName and token = :token]
I had to modify the source code to not use the batch DML for now only in two methods that delete the timers. I'm going to modify the other code like that if we have the same issues as we go.
The following is the code I use:
private static final String deleteTimersQuery =
"from org.jbpm.scheduler.exe.Timer t " +
"where t.name = :timerName" +
" and t.token = :token";
public void cancelTimers(SchedulerInstance.CancelledTimer cancelledTimer) {
try {
Query query = session.createQuery(deleteTimersQuery);
query.setString("timerName", cancelledTimer.getTimerName());
query.setEntity("token", cancelledTimer.getToken());
List timers = query.list();
for (Iterator ti = timers.iterator(); ti.hasNext();) {
Timer timer = (Timer) ti.next();
session.delete(timer);
}
} catch (Exception e) {
log.error(e);
jbpmSession.handleException();
throw new RuntimeException("couldn't delete timers '"+cancelledTimer.getTimerName()+"' on token '"+cancelledTimer.getToken().getId()+"' from the database", e);
}
}
private static final String deleteTimersForProcessInstanceQuery =
"from org.jbpm.scheduler.exe.Timer t " +
"where t.processInstance = :processInstance";
public void cancelTimersForProcessInstance(ProcessInstance processInstance) {
try {
Query query = session.createQuery(deleteTimersForProcessInstanceQuery);
query.setEntity("processInstance", processInstance);
List timers = query.list();
for (Iterator ti = timers.iterator(); ti.hasNext();) {
Timer timer = (Timer) ti.next();
session.delete(timer);
}
} catch (Exception e) {
log.error(e);
jbpmSession.handleException();
throw new RuntimeException("couldn't delete timers for process instance '"+processInstance+"'", e);
}
}
|
Show » |
|
|