[jboss-user] [jBPM] - Violation of UNIQUE KEY constraint with sub-process

Ryan Bartlett do-not-reply at jboss.com
Fri Aug 6 21:27:10 EDT 2010


Ryan Bartlett [http://community.jboss.org/people/RyanLBart] created the discussion

"Violation of UNIQUE KEY constraint with sub-process"

To view the discussion, visit: http://community.jboss.org/message/556328#556328

--------------------------------------------------------------
I am getting the following Exception when using sub-processes (.jpdl.xml files are below). I have removed the subprocesses and everything works fine. When I add them back in, I get the ConstraintViolation.

My environment is using MSSQL Server and we have not modified any of the JBPM defaults for transactions, id generators, etc. Any clues? I have seen some other posts regarding this issue, but haven't seen a clear answer except for perhaps there is a bug in the id generator.

Thanks!

Starting execution:
ProcessInstance processInstance = executionService.startProcessInstanceByKey(message.getClass().getCanonicalName(),  +parameters); String processInstanceId = processInstance.getId();IMessage response = (IMessage) executionService.getVariable(processInstanceId, S_MESSAGE_RESPONSE);  executionService.endProcessInstance(processInstanceId, "end"); ++
+


Stack trace:
2010-08-06 18:15:49,686 ERROR bus.thread.pool-1-message.processing.thread-1 org.hibernate.util.JDBCExceptionReporter - Violation of UNIQUE KEY constra
int 'UQ__JBPM4_EXECUTION__67C95AEA'. Cannot insert duplicate key in object 'dbo.JBPM4_EXECUTION'.
2010-08-06 18:15:49,686 ERROR bus.thread.pool-1-message.processing.thread-1 org.hibernate.event.def.AbstractFlushingEventListener - Could not synchron
ize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
        at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:114)
        at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)
        at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2252)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2688)
        at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
        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:167)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)


Main JPDL file:
<process name='com.e3.es.order.messages.createorder.defn.v2.CreateOrderRequestType' 
 key='com.e3.es.order.messages.createorder.defn.v2.CreateOrderRequestType' 
id='create'>
 <start>
  <transition to='beginProcessing'/>
 </start>

 <java name='beginProcessing'
  class='com.e3.es.order.service.jbpm.handler.RequestHandler'
  method='getProcessingContext'
  var='processingContext'>
  <arg><object expr='#{serviceRequest}'/></arg>
  <transition to='verify'/>
 </java>

 <sub-process name='verify' sub-process-key="supply.verify">
  <parameter-in var="processingContext" subvar="processingContext" />
  <transition to='holdPurchases'/>
 </sub-process>
 
<java name='holdPurchases'
  class='com.e3.es.order.service.jbpm.handler.general.AdaptorRequestHandler'
  method='handle'>
  <arg><string value='hold'/></arg>
  <arg><object expr='#{processingContext}'/></arg>
  <arg><string value='Role=RequestedProductDetail;ProcessingModel=Two-Phase'/></arg>
  <transition to='wait'/>
 </java>
 <state name='wait'/>
<end name='end'></end>
</process>

Subprocess:
<process name='supply.verify' key='supply.verify'>
 <start>
  <transition to='supplyverify'/>
 </start>
 <java name='supplyverify'
  class='com.e3.es.order.service.jbpm.handler.general.AdaptorRequestHandler'
  method='handle'>
  <arg><string value='verify'/></arg>
  <arg><object expr='#{processingContext}'/></arg>
  <arg><string value='Role=RequestedProductDetail,PaymentPlan'/></arg>
  <transition to='end'/>
 </java>
 <end name='end'></end>
</process>

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/556328#556328]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100806/771dc42f/attachment.html 


More information about the jboss-user mailing list