[jboss-user] [JBoss jBPM] - Re: Problems with indexes in jbpm.history.hbm.xml

hwa do-not-reply at jboss.com
Wed Aug 19 14:53:12 EDT 2009


Test cases that demonstrates the two situations with the same db error messages: one without the Java node (which prints out errors but continues the workflow process without any blocking issues), another with the Java node (which prints out errors and gets stuck in infinite loop while exporting schema to db over and over again).

For both cases, I use the same Java code; relevant snippet from my App.java is shown here.

App.java:

  |     private ProcessEngine processEngine;
  |     private RepositoryService repositoryService;
  |     private ExecutionService executionService;
  |     private TaskService taskService;
  |     
  |     private Map<String, Object> caseinfo = new HashMap<String, Object>();
  |     private int tenth = 0;
  | 
  |     public App() {
  | 	    processEngine = new Configuration().buildProcessEngine();
  | 	    repositoryService = processEngine.getRepositoryService();
  | 	    executionService = processEngine.getExecutionService();
  | 	    taskService = processEngine.getTaskService();
  | 	    
  | 	    repositoryService.createDeployment().addResourceFromClasspath("workflow.jpdl.xml").deploy();
  |     }
  | 
  |     public String whatCond() {
  |     	tenth++;
  |     	if (tenth == 10) {
  |             tenth = 0;
  |             log.info("Checking isTenth: YES");
  |     		return "yes";
  |     	} else {
  |             log.info("Checking isTenth: NO");
  |     		return "no";
  |     	}
  |     }
  |     
  |     public String runPOC(String arg) {
  |     	ProcessInstance processInstance = executionService.startProcessInstanceByKey("test");
  |     	String pid = processInstance.getId();
  |         String cond = "yes";
  | 
  |     	List<Task> taskList = taskService.findPersonalTasks("cathy");
  |     	Task task = taskList.get(0);
  |     	String taskDbid = task.getId();
  |         Map<String, Object> variables = new HashMap<String, Object>();
  |         variables.put("arg", arg);
  |         variables.put("cond", cond);
  | 		taskService.setVariables(taskDbid, variables);
  |     	taskService.completeTask(taskDbid);
  | 
  |     	processInstance = executionService.findProcessInstanceById(pid);
  |     	String result = processInstance.findActiveActivityNames().toArray()[0].toString();
  |             log.info("Result: " + result);
  |         
  |         return result;
  |     }
  | 

Here's the test case with no Java nodes where it prints out the error message but continues without any blocking issues.

workflow.jpdl.xml:

  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process name="test" xmlns="http://jbpm.org/4.0/jpdl">
  |    <decision expr="#{arg}" g="228,336,61,49" name="runJava?">
  |       <transition g="-5,5" name="no" to="nojava"/>
  |       <transition name="yes" to="java" g="-44,-21"/>
  |    </decision>
  |    <task assignee="cathy" g="60,336,97,49" name="new">
  |       <transition g="-24,-18" name="to runJava?" to="runJava?"/>
  |    </task>
  |    <task assignee="peter" g="276,216,97,49" name="nojava">
  |       <transition g="-41,-21" name="to end" to="end"/>
  |    </task>
  |    <task assignee="cathy" g="612,456,97,49" name="bad">
  |       <transition g="-21,-16" name="to end" to="end"/>
  |    </task>
  |    <task assignee="peter" g="444,336,97,49" name="good">
  |       <transition g="-41,-21" name="to end" to="end"/>
  |    </task>
  |    <end g="636,336,49,49" name="end"/>
  |    <start g="84,216,49,49" name="start">
  |       <transition g="7,-11" name="to new" to="new"/>
  |    </start>
  |    <decision expr="#{cond}" g="468,456,49,49" name="condition?">
  |       <transition g="-11,-18" name="no" to="bad"/>
  |       <transition g="-21,-3" name="yes" to="good"/>
  |    </decision>
  |    <state name="java" g="288,456,97,49">
  |       <transition name="to condition?" to="condition?" g="-40,-21"/>
  |    </state>
  | </process>
  | 

Errors appears but workflow continues. In the example here, I pass runPOC with arg "no" first, then I tried it with arg "yes":

  | 11:49:07,678 INFO  [SchemaExport] exporting generated schema to database
  | 11:49:10,256 SEVERE [SchemaExport] Unsuccessful: create index IDX_HDETAIL_HVAR on JBPM4_HIST_DETAIL (HVAR_)
  | 11:49:10,256 SEVERE [SchemaExport] ORA-01408: such column list already indexed
  | 
  | 11:49:10,256 SEVERE [SchemaExport] Unsuccessful: create index IDX_HDETAIL_HTASK on JBPM4_HIST_DETAIL (HTASK_)
  | 11:49:10,272 SEVERE [SchemaExport] ORA-01408: such column list already indexed
  | 
  | 11:49:10,272 SEVERE [SchemaExport] Unsuccessful: create index IDX_HDETAIL_HACTI on JBPM4_HIST_DETAIL (HACTI_)
  | 11:49:10,272 SEVERE [SchemaExport] ORA-01408: such column list already indexed
  | 
  | 11:49:10,272 SEVERE [SchemaExport] Unsuccessful: create index IDX_HDETAIL_HPROCI on JBPM4_HIST_DETAIL (HPROCI_)
  | 11:49:10,272 SEVERE [SchemaExport] ORA-01408: such column list already indexed
  | 
  | 11:49:10,912 INFO  [SchemaExport] schema export complete
  | 11:50:47,148 INFO  [App] Result: nojava
  | 11:50:50,711 INFO  [App] Result: java
  | 

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

Here is the test case where it prints out the error message but does NOT work and cannot start the workflow process.

workflow.jpdl.xml:

  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process name="test" xmlns="http://jbpm.org/4.0/jpdl">
  |    <decision expr="#{arg}" g="228,336,61,49" name="runJava?">
  |       <transition g="-4,-20" name="yes" to="java"/>
  |       <transition g="-5,5" name="no" to="nojava"/>
  |    </decision>
  |    <decision expr="#{cond}" g="468,456,49,49" name="condition?">
  |       <transition g="-11,-18" name="no" to="bad"/>
  |       <transition g="-21,-3" name="yes" to="good"/>
  |    </decision>
  |    <task assignee="cathy" g="60,336,97,49" name="new">
  |       <transition g="-24,-18" name="to runJava?" to="runJava?"/>
  |    </task>
  |    <task assignee="peter" g="276,216,97,49" name="nojava">
  |       <transition name="to end" to="end" g="-41,-21"/>
  |    </task>
  |    <java class="com.hwa.poc.server.App" continue="sync" g="276,456,97,49" method="whatCond" name="java" var="cond">
  |       <transition g="-40,-18" name="to condition?" to="condition?"/>
  |    </java>
  |    <task assignee="cathy" g="612,456,97,49" name="bad">
  |       <transition g="-21,-16" name="to end" to="end"/>
  |    </task>
  |    <task assignee="peter" g="444,336,97,49" name="good">
  |       <transition name="to end" to="end" g="-41,-21"/>
  |    </task>
  |    <end g="636,336,49,49" name="end"/>
  |    <start g="84,216,49,49" name="start">
  |       <transition g="7,-11" name="to new" to="new"/>
  |    </start>
  | </process>
  | 

Then the following will repeat over and over again in some infinite loop without ever starting the workflow process.

  | 11:31:36,580 INFO  [Configuration] configuring from resource: jbpm.hibernate.cfg.xml
  | 11:31:36,580 INFO  [Configuration] Configuration resource: jbpm.hibernate.cfg.xml
  | 11:31:36,580 INFO  [Configuration] Reading mappings from resource : jbpm.repository.hbm.xml
  | 11:31:36,595 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.repository.DeploymentImpl -> JBPM4_DEPLOYMENT
  | 11:31:36,595 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.repository.DeploymentProperty -> JBPM4_DEPLOYPROP
  | 11:31:36,595 INFO  [Configuration] Reading mappings from resource : jbpm.execution.hbm.xml
  | 11:31:36,642 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.model.ExecutionImpl -> JBPM4_EXECUTION
  | 11:31:36,658 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.type.Variable -> JBPM4_VARIABLE
  | 11:31:36,658 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.type.variable.DateVariable -> JBPM4_VARIABLE
  | 11:31:36,658 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.type.variable.DoubleVariable -> JBPM4_VARIABLE
  | 11:31:36,658 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.type.variable.HibernateLongVariable -> JBPM4_VARIABLE
  | 11:31:36,705 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.type.variable.LongVariable -> JBPM4_VARIABLE
  | 11:31:36,705 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.type.variable.HibernateStringVariable -> JBPM4_VARIABLE
  | 11:31:36,705 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.type.variable.StringVariable -> JBPM4_VARIABLE
  | 11:31:36,705 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.type.variable.TextVariable -> JBPM4_VARIABLE
  | 11:31:36,705 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.type.variable.NullVariable -> JBPM4_VARIABLE
  | 11:31:36,705 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.type.variable.BlobVariable -> JBPM4_VARIABLE
  | 11:31:36,705 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.lob.Lob -> JBPM4_LOB
  | 11:31:36,705 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.job.JobImpl -> JBPM4_JOB
  | 11:31:36,720 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.job.MessageImpl -> JBPM4_JOB
  | 11:31:36,720 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.model.op.ExecuteActivityMessage -> JBPM4_JOB
  | 11:31:36,720 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage -> JBPM4_JOB
  | 11:31:36,720 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.job.CommandMessage -> JBPM4_JOB
  | 11:31:36,720 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.job.TimerImpl -> JBPM4_JOB
  | 11:31:36,720 INFO  [Configuration] Reading mappings from resource : jbpm.history.hbm.xml
  | 11:31:36,751 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl -> JBPM4_HIST_PROCINST
  | 11:31:36,751 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl -> JBPM4_HIST_ACTINST
  | 11:31:36,767 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryAutomaticInstanceImpl -> JBPM4_HIST_ACTINST
  | 11:31:36,767 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryDecisionInstanceImpl -> JBPM4_HIST_ACTINST
  | 11:31:36,767 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl -> JBPM4_HIST_ACTINST
  | 11:31:36,767 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.history.model.HistoryTaskImpl -> JBPM4_HIST_TASK
  | 11:31:36,767 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.history.model.HistoryVariableImpl -> JBPM4_HIST_VAR
  | 11:31:36,767 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.history.model.HistoryDetailImpl -> JBPM4_HIST_DETAIL
  | 11:31:36,767 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryCommentImpl -> JBPM4_HIST_DETAIL
  | 11:31:36,767 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryPriorityUpdateImpl -> JBPM4_HIST_DETAIL
  | 11:31:36,767 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryTaskAssignmentImpl -> JBPM4_HIST_DETAIL
  | 11:31:36,767 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryTaskDuedateUpdateImpl -> JBPM4_HIST_DETAIL
  | 11:31:36,767 INFO  [HbmBinder] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryVariableUpdateImpl -> JBPM4_HIST_DETAIL
  | 11:31:36,767 INFO  [Configuration] Reading mappings from resource : jbpm.task.hbm.xml
  | 11:31:36,783 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.task.TaskImpl -> JBPM4_TASK
  | 11:31:42,830 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.task.ParticipationImpl -> JBPM4_PARTICIPATION
  | 11:31:42,830 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.task.SwimlaneImpl -> JBPM4_SWIMLANE
  | 11:31:42,830 INFO  [Configuration] Reading mappings from resource : jbpm.identity.hbm.xml
  | 11:31:42,861 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.identity.impl.UserImpl -> JBPM4_ID_USER
  | 11:31:42,861 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.identity.impl.MembershipImpl -> JBPM4_ID_MEMBERSHIP
  | 11:31:42,861 INFO  [HbmBinder] Mapping class: org.jbpm.pvm.internal.identity.impl.GroupImpl -> JBPM4_ID_GROUP
  | 11:31:42,861 INFO  [Configuration] Configured SessionFactory: null
  | 11:31:42,877 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.repository.DeploymentImpl.resources -> JBPM4_LOB
  | 11:31:42,877 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.repository.DeploymentImpl.objectProperties -> JBPM4_DEPLOYPROP
  | 11:31:42,877 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.model.ExecutionImpl.variables -> JBPM4_VARIABLE
  | 11:31:42,877 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.model.ExecutionImpl.systemVariables -> JBPM4_VARIABLE
  | 11:31:42,877 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.model.ExecutionImpl.executions -> JBPM4_EXECUTION
  | 11:31:42,877 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.model.ExecutionImpl.swimlanes -> JBPM4_SWIMLANE
  | 11:31:42,892 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl.historyActivityInstances -> JBPM4_HI
  | ST_ACTINST
  | 11:31:42,892 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl.historyVariables -> JBPM4_HIST_VAR
  | 11:31:42,892 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl.details -> JBPM4_HIST_DETAIL
  | 11:31:42,892 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl.details -> JBPM4_HIST_DETAIL
  | 11:31:42,892 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryTaskImpl.details -> JBPM4_HIST_DETAIL
  | 11:31:42,892 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryTaskImpl.historyVariables -> JBPM4_HIST_VAR
  | 11:31:42,892 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryTaskImpl.subTasks -> JBPM4_HIST_TASK
  | 11:31:42,908 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryVariableImpl.details -> JBPM4_HIST_DETAIL
  | 11:31:42,908 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryCommentImpl.replies -> JBPM4_HIST_DETAIL
  | 11:31:42,908 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.task.TaskImpl.participations -> JBPM4_PARTICIPATION
  | 11:31:42,908 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.task.TaskImpl.variables -> JBPM4_VARIABLE
  | 11:31:42,908 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.task.TaskImpl.subTasks -> JBPM4_TASK
  | 11:31:42,923 INFO  [HbmBinder] Mapping collection: org.jbpm.pvm.internal.task.SwimlaneImpl.participations -> JBPM4_PARTICIPATION
  | 11:31:42,923 INFO  [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
  | 11:31:42,923 INFO  [DriverManagerConnectionProvider] Hibernate connection pool size: 20
  | 11:31:42,923 INFO  [DriverManagerConnectionProvider] autocommit mode: false
  | 11:31:42,923 INFO  [DriverManagerConnectionProvider] using driver: oracle.jdbc.OracleDriver at URL: jdbc:oracle:oci:@orcl
  | 11:31:42,939 INFO  [DriverManagerConnectionProvider] connection properties: {user=jbpm, password=****}
  | 11:31:43,002 INFO  [SettingsFactory] RDBMS: Oracle, version: Oracle Database 10g Release 10.2.0.1.0 - Production
  | 11:31:43,002 INFO  [SettingsFactory] JDBC driver: Oracle JDBC driver, version: 10.2.0.1.0
  | 11:31:43,002 INFO  [Dialect] Using dialect: org.hibernate.dialect.Oracle10gDialect
  | 11:31:43,002 INFO  [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
  | 11:31:43,002 INFO  [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional se
  | cond-level cache is not recommended)
  | 11:31:43,002 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): disabled
  | 11:31:43,017 INFO  [SettingsFactory] Automatic session close at end of transaction: disabled
  | 11:31:43,017 INFO  [SettingsFactory] JDBC batch size: 15
  | 11:31:43,017 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled
  | 11:31:43,017 INFO  [SettingsFactory] Scrollable result sets: enabled
  | 11:31:43,017 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
  | 11:31:43,017 INFO  [SettingsFactory] Connection release mode: auto
  | 11:31:43,017 INFO  [SettingsFactory] Default batch fetch size: 1
  | 11:31:43,017 INFO  [SettingsFactory] Generate SQL with comments: disabled
  | 11:31:43,017 INFO  [SettingsFactory] Order SQL updates by primary key: disabled
  | 11:31:43,017 INFO  [SettingsFactory] Order SQL inserts for batching: disabled
  | 11:31:43,017 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
  | 11:31:43,017 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
  | 11:31:43,017 INFO  [SettingsFactory] Query language substitutions: {}
  | 11:31:43,017 INFO  [SettingsFactory] JPA-QL strict compliance: disabled
  | 11:31:43,017 INFO  [SettingsFactory] Second-level cache: enabled
  | 11:31:43,017 INFO  [SettingsFactory] Query cache: disabled
  | 11:31:43,017 INFO  [SettingsFactory] Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
  | 11:31:43,017 INFO  [SettingsFactory] Optimize cache for minimal puts: disabled
  | 11:31:43,033 INFO  [SettingsFactory] Structured second-level cache entries: disabled
  | 11:31:43,033 INFO  [SettingsFactory] Statistics: disabled
  | 11:31:43,033 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
  | 11:31:43,033 INFO  [SettingsFactory] Default entity-mode: pojo
  | 11:31:43,033 INFO  [SettingsFactory] Named query checking : enabled
  | 11:31:43,033 INFO  [SessionFactoryImpl] building session factory
  | 11:31:43,173 INFO  [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
  | 11:31:43,189 INFO  [SchemaExport] Running hbm2ddl schema export
  | 11:31:43,189 INFO  [SchemaExport] exporting generated schema to database
  | 11:31:35,689 SEVERE [SchemaExport] Unsuccessful: create index IDX_HDETAIL_HVAR on JBPM4_HIST_DETAIL (HVAR_)
  | 11:31:35,689 SEVERE [SchemaExport] ORA-01408: such column list already indexed
  | 
  | 11:31:35,705 SEVERE [SchemaExport] Unsuccessful: create index IDX_HDETAIL_HTASK on JBPM4_HIST_DETAIL (HTASK_)
  | 11:31:35,705 SEVERE [SchemaExport] ORA-01408: such column list already indexed
  | 
  | 11:31:35,705 SEVERE [SchemaExport] Unsuccessful: create index IDX_HDETAIL_HACTI on JBPM4_HIST_DETAIL (HACTI_)
  | 11:31:35,705 SEVERE [SchemaExport] ORA-01408: such column list already indexed
  | 
  | 11:31:35,705 SEVERE [SchemaExport] Unsuccessful: create index IDX_HDETAIL_HPROCI on JBPM4_HIST_DETAIL (HPROCI_)
  | 11:31:35,736 SEVERE [SchemaExport] ORA-01408: such column list already indexed
  | 
  | 11:31:36,408 INFO  [SchemaExport] schema export complete
  | 

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

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



More information about the jboss-user mailing list