[jbpm-issues] [JBoss JIRA] Commented: (JBPM-1135) JobSession.deleteJobsForProcessInstance doesn't work if jbpm isn't the transaction manager

Alejandro Guizar (JIRA) jira-events at lists.jboss.org
Wed Aug 20 07:12:22 EDT 2008


    [ https://jira.jboss.org/jira/browse/JBPM-1135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12425813#action_12425813 ] 

Alejandro Guizar commented on JBPM-1135:
----------------------------------------

Running the TimerOnTimerDbTest on Linux reveals a stale state exception that should not appear:

org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.job.Timer#2]
	at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1769)
	at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2528)
	at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2702)
	at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:77)
	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
	at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
	at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
	at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:263)
	at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:218)
	at org.jbpm.svc.Services.close(Services.java:236)
	at org.jbpm.JbpmContext.close(JbpmContext.java:139)
	at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:180)
	at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:57)

The timer is deleted twice. The first time in CancelTimerAction.execute() and the second time in JobExecutorThread.executeJob(). Excluding locked jobs from the JobSession.getTimersByName query prevents the first deletion and, in consequence, the stale state exception.

> JobSession.deleteJobsForProcessInstance doesn't work if jbpm isn't the transaction manager
> ------------------------------------------------------------------------------------------
>
>                 Key: JBPM-1135
>                 URL: https://jira.jboss.org/jira/browse/JBPM-1135
>             Project: JBoss jBPM
>          Issue Type: Bug
>          Components: Core Engine
>    Affects Versions: jPDL 3.2.2
>            Reporter: Jérôme Tellier
>            Assignee: Alejandro Guizar
>             Fix For: JBossBPM-3.3.0
>
>         Attachments: processdefinition.xml, timerTest2.log
>
>
> My configuration of the persistence service is this :
>     <service name="persistence">
>       <factory>
>         <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
>           <field name="isCurrentSessionEnabled"><false /></field>
>           <field name="isTransactionEnabled"><false /></field>
>         </bean>
>       </factory>
>     </service>
> When I call JobSession.deleteJobsForProcessInstance, the method beforeCompletion() in DeleteJobsSynchronization is never call in the commit, probably because jbpm isn't the transaction manager.

-- 
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

       




More information about the jbpm-issues mailing list