Hi all,

I'm having a bit of difficulty with timers and saving the process instance. I'm 
using version 3.0.2.

If a timer is executed by the Scheduler and during the workflow execution 
initiated by this timer I call 
JbpmSession.getCurrentJbpmSession().getGraphSession().saveProcessInstance(pi)
then when the token finally comes to a wait state, the GraphSession, whose 
Hibernate session is apparently not related to the Hibernate session of the 
Scheduler, has already deleted the Timer. So when the Scheduler tries to delete 
the timer I get:

20 April 2006 20:17:54,976 DEBUG [AbstractBatcher] about to open 
PreparedStatement (open PreparedStatements: 3, globally: 3)
  | 20 April 2006 20:17:54,976 DEBUG [SQL] delete from JBPM_TIMER where ID_=?
  | 20 April 2006 20:17:54,976 DEBUG [AbstractBatcher] preparing statement
  | 20 April 2006 20:17:54,976 DEBUG [LongType] binding '4678' to parameter: 1
  | 20 April 2006 20:17:54,976 DEBUG [AbstractBatcher] Adding to batch
  | 20 April 2006 20:17:54,976 DEBUG [AbstractBatcher] Executing batch size: 1
  | 20 April 2006 20:17:54,992 ERROR [AbstractBatcher] Exception executing 
batch: 
  | org.hibernate.StaleStateException: Batch update returned unexpected row 
count from update: 0 actual row count: 0 expected: 1
  |     at 
org.hibernate.jdbc.BatchingBatcher.checkRowCount(BatchingBatcher.java:92)
  |     at 
org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:78)
  |     at 
org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
  |     at 
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:172)
  |     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226)
  |     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
  |     at 
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
  |     at 
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
  |     at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:716)
  |     at org.jbpm.db.JbpmSession.commitTransaction(JbpmSession.java:104)
  |     at 
org.jbpm.db.JbpmSession.commitTransactionAndClose(JbpmSession.java:131)
  |     at 
org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:121)
  |     at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:34)

and the entire transaction rolls back.

I don't know a lot about Hibernate, so I hope I'm making sense. The only way 
I've found to prevent this from happening is to forego saving the 
ProcessInstance, which means I don't get the detailed logging.

Anyone else had this problem or have any ideas for me?

Thanks!

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3938576#3938576

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3938576


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to