[JBoss JIRA] Commented: (JBPM-575) delete Timer fails in Scheduler
by Alejandro Guizar (JIRA)
[ https://jira.jboss.org/jira/browse/JBPM-575?page=com.atlassian.jira.plugi... ]
Alejandro Guizar commented on JBPM-575:
---------------------------------------
I wrote a unit test as part of a related issue, JBPM-1135. The JBPM1135Test exercises the situation where the process instance ends within the timer execution. We should be able to close this issue as duplicate of JBPM-1135.
> delete Timer fails in Scheduler
> -------------------------------
>
> Key: JBPM-575
> URL: https://jira.jboss.org/jira/browse/JBPM-575
> Project: JBoss jBPM
> Issue Type: Bug
> Components: Core Engine
> Affects Versions: jBPM 3.1.0
> Environment: jbpm 3.1, PostgreSQL / MS SQL Server / DB/2, jboss 4.0.4 RC1
> Reporter: maplat
> Original Estimate: 10 minutes
> Remaining Estimate: 10 minutes
>
> if a timer is scheduled, which execution leeds to the process end, the timer can not be deleted,
> because at the end of the process instance all timers are canceld and after this the scheduler also tries
> to delete the timer
> I did a change on SchedulerSession.cancelTimersForProcessInstance
> (the commented code ist the original one, I also added a new named query to hibernate.queries.hbm.xml)
> The change does not directly delete the timers from database, it calls the deleteTimer methode, which causes the
> timers beeing deleted to be added to the deletedTimers collection. If another delete is done from the scheduler
> it is ignored, because in the delete timer methode the deletedTImers collection is checked.
> public void cancelTimersForProcessInstance(ProcessInstance processInstance) {
> try {
> /*Query query = session.getNamedQuery("SchedulerSession.deleteTimersForProcessInstance");
> query.setEntity("processInstance", processInstance);
> query.executeUpdate();*/
> Query query = session.getNamedQuery("SchedulerSession.findTimersForProcessInstance");
> query.setEntity("processInstance", processInstance);
> Iterator iter = query.list().iterator();
> while(iter.hasNext()) {
> deleteTimer((Timer) iter.next());
> }
> } catch (Exception e) {
> log.error(e);
> jbpmSession.handleException();
> throw new JbpmException("couldn't delete timers for process instance '"+processInstance+"'", e);
> }
> }
> -- new named query
> <query name="SchedulerSession.findTimersForProcessInstance">
> <![CDATA[
> select t from org.jbpm.scheduler.exe.Timer t
> where t.processInstance = :processInstance
> ]]>
> </query>
> I'm not sure if the deleteTimersForProcessInstance query is used somewhere else, so I left it.
> If this approch is right, someone of the developers maybe can fix it in the code, I do not have access to it
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month
[JBoss JIRA] Commented: (JBPM-575) delete Timer fails in Scheduler
by Martin Putz (JIRA)
[ https://jira.jboss.org/jira/browse/JBPM-575?page=com.atlassian.jira.plugi... ]
Martin Putz commented on JBPM-575:
----------------------------------
I don't have a unit test, but I just ran a process where the firing of a timer leads to the process end both with jBPM 3.1.4 and 3.2.3, and can confirm that this fails in 3.1.4 with a org.hibernate.StaleStateException, whereas there are no problems in 3.2.3.
> delete Timer fails in Scheduler
> -------------------------------
>
> Key: JBPM-575
> URL: https://jira.jboss.org/jira/browse/JBPM-575
> Project: JBoss jBPM
> Issue Type: Bug
> Components: Core Engine
> Affects Versions: jBPM 3.1.0
> Environment: jbpm 3.1, PostgreSQL / MS SQL Server / DB/2, jboss 4.0.4 RC1
> Reporter: maplat
> Original Estimate: 10 minutes
> Remaining Estimate: 10 minutes
>
> if a timer is scheduled, which execution leeds to the process end, the timer can not be deleted,
> because at the end of the process instance all timers are canceld and after this the scheduler also tries
> to delete the timer
> I did a change on SchedulerSession.cancelTimersForProcessInstance
> (the commented code ist the original one, I also added a new named query to hibernate.queries.hbm.xml)
> The change does not directly delete the timers from database, it calls the deleteTimer methode, which causes the
> timers beeing deleted to be added to the deletedTimers collection. If another delete is done from the scheduler
> it is ignored, because in the delete timer methode the deletedTImers collection is checked.
> public void cancelTimersForProcessInstance(ProcessInstance processInstance) {
> try {
> /*Query query = session.getNamedQuery("SchedulerSession.deleteTimersForProcessInstance");
> query.setEntity("processInstance", processInstance);
> query.executeUpdate();*/
> Query query = session.getNamedQuery("SchedulerSession.findTimersForProcessInstance");
> query.setEntity("processInstance", processInstance);
> Iterator iter = query.list().iterator();
> while(iter.hasNext()) {
> deleteTimer((Timer) iter.next());
> }
> } catch (Exception e) {
> log.error(e);
> jbpmSession.handleException();
> throw new JbpmException("couldn't delete timers for process instance '"+processInstance+"'", e);
> }
> }
> -- new named query
> <query name="SchedulerSession.findTimersForProcessInstance">
> <![CDATA[
> select t from org.jbpm.scheduler.exe.Timer t
> where t.processInstance = :processInstance
> ]]>
> </query>
> I'm not sure if the deleteTimersForProcessInstance query is used somewhere else, so I left it.
> If this approch is right, someone of the developers maybe can fix it in the code, I do not have access to it
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month
[JBoss JIRA] Created: (JBPM-1786) Failed to create timer
by Heiko Braun (JIRA)
Failed to create timer
----------------------
Key: JBPM-1786
URL: https://jira.jboss.org/jira/browse/JBPM-1786
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Console
Reporter: Heiko Braun
Assignee: Heiko Braun
Fix For: jBPM 3.3.0 GA
Use the jsf console create an instance of 'websale' and submit ('evaluate') the 'Create new web sale order' task
raises the following exception:
14:50:36,925 ERROR [GraphElement] action threw exception: Failed to create timer
javax.ejb.TransactionRolledbackLocalException: Failed to create timer
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:262)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:527)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:65)
at $Proxy78.createTimer(Unknown Source)
at org.jbpm.scheduler.ejbtimer.EntitySchedulerService.createTimer(EntitySchedulerService.java:45)
at org.jbpm.scheduler.def.CreateTimerAction.execute(CreateTimerAction.java:80)
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:256)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month