[jboss-user] [jBPM Users] - Re: deploy() takes an awefully LONG time

ajaygautam do-not-reply at jboss.com
Thu Dec 10 13:56:26 EST 2009


This statement takes all the time:

  | ProcessDeployer.java line 134, method checkKey().
  | 
  | 
  |     List<ProcessDefinition> existingProcesses = repositorySession.createProcessDefinitionQuery()
  |         .processDefinitionName(processDefinitionName)
  |         .list();
  | 

Then the code goes on to perform a "find":

  |     for (ProcessDefinition existingProcess: existingProcesses) {
  |       if (!processDefinitionKey.equals(existingProcess.getKey())) {
  |         deployment.addProblem("invalid key '"+processDefinitionKey+"' in process "+processDefinition.getName()+".  Existing process has name '"+processDefinitionName+"' and key '"+processDefinitionKey+"'");
  |       }
  |     }
  | 

uuumm.... shouldn't the query actually be performed at the database level !?!?

On top of that, here is the code that performs the actual query:


  |   public Object execute(Session session) {
  |     List<Map<String, Object>> propertyMaps = (List<Map<String, Object>>) super.execute(session);
  |     
  |     List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
  |     for (Map<String, Object> properties: propertyMaps) {
  |       String deploymentId = properties.get("deploymentDbid").toString();
  |       String objectName = (String)properties.get("objectName");
  |       RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
  |       ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.getObject(deploymentId, objectName);
  |       processDefinitions.add(processDefinition);
  |     }
  |     
  |     return processDefinitions;
  |   }
  | 

So, instead of loading everything from the database in one go, its loading data one row at a time! - FROM THE DATABASE !! HOLY PENGUIN!

Whats going on?

The symptom is magnified, by the fact that the process is running in US, and the database is in UK!

Or am I using it wrong?

Ajay

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

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



More information about the jboss-user mailing list