[jboss-user] [JBoss jBPM] - Problem Creating ProcessInstance

mchicote do-not-reply at jboss.com
Thu Mar 29 14:09:26 EDT 2007


Hi, the code is like this:


  | 		JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  | 		ProcessInstance instance = jbpmContext.newProcessInstance("DefinitionName");
  | 		jbpmContext.close();
  | 

When it inserts the first ProcessInstance (first in the table, id = 1) it runs fine.
When I tried to insert a second ProcessInstance it fails:


  | Hibernate: 
  |     insert 
  |     into
  |         JBPM_PROCESSINSTANCE
  |         (VERSION_, KEY_, START_, END_, ISSUSPENDED_, PROCESSDEFINITION_, ROOTTOKEN_, SUPERPROCESSTOKEN_) 
  |     values
  |         (?, ?, ?, ?, ?, ?, ?, ?) select
  |             scope_identity()
  | 14:56:33,140 [main] WARN  JDBCExceptionReporter : SQL Error: 2627, SQLState: 23000
  | 14:56:33,140 [main] ERROR JDBCExceptionReporter : [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Violation of UNIQUE KEY constraint 'UQ__JBPM_PROCESSINST__731B1205'. Cannot insert duplicate key in object 'JBPM_PROCESSINSTANCE'.
  | 14:56:33,140 [main] WARN  JDBCExceptionReporter : SQL Error: 3621, SQLState: HY000
  | 14:56:33,140 [main] ERROR JDBCExceptionReporter : [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The statement has been terminated.
  | Exception in thread "main" org.jbpm.persistence.JbpmPersistenceException: couldn't assign id to org.jbpm.graph.exe.ProcessInstance at 16de067
  | 

Violation of unique key constrain? In JBPM_PROCESSINSTANCE table the id has identity "yes" (autonumeric), in the hibernate entity configuration file for ProcessInstance the id is "native", even in the executed sql there's no ID for insert. So, what's happening? It should insert a row with id=2 but it says that the id is duplicated. 

Thanks!



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

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



More information about the jboss-user mailing list