Discussion:
[jboss-user] [jBPM] - Error "Timeout trying to lock table 'PROCESSINSTANCELOG'"
dimmordino
2013-04-02 21:06:00 UTC
Permalink
dimmordino [https://community.jboss.org/people/dimmordino] created the discussion

"Error "Timeout trying to lock table 'PROCESSINSTANCELOG'""

To view the discussion, visit: https://community.jboss.org/message/806104#806104

--------------------------------------------------------------
I tried to deploy a simple process that just has 1 script task that prints something out, sleeps for a while and then prints something out again. I uploaded the bpmn to guvnor and built the package. I can see the process in the jbpm-console, but when i try to start an instance, and click refresh so that i can see the running instance, it gives me the following error in the logs:

ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--127.0.0.1-8080-2) Timeout trying to lock table "PROCESSINSTANCELOG";

Is there a step i'm missing? maybe a persistence configuration change somewhere? I am using whatever configuration comes with the demo install.

thanks,
   Dave
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Massimiliano Izzo
2013-05-31 10:22:48 UTC
Permalink
Massimiliano Izzo [https://community.jboss.org/people/amizzo] created the discussion

"Re: Error "Timeout trying to lock table 'PROCESSINSTANCELOG'""

To view the discussion, visit: https://community.jboss.org/message/820643#820643

--------------------------------------------------------------
I am having the same problem!
I think, too, that the Script Task cannot be persistent. I can see

jbpm.console.task.service.strategy=HornetQ

in the default.jbpm.console.properties file in the jBPM console server war, but I don't know what to put here to disable the task persistence

:-/ :((
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
dimmordino
2013-05-31 14:04:07 UTC
Permalink
dimmordino [https://community.jboss.org/people/dimmordino] created the discussion

"Re: Error "Timeout trying to lock table 'PROCESSINSTANCELOG'""

To view the discussion, visit: https://community.jboss.org/message/820692#820692

--------------------------------------------------------------
Unfortunately i did not resolve this issue. I have moved on to using another BPM product.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Massimiliano Izzo
2013-06-03 17:02:19 UTC
Permalink
Massimiliano Izzo [https://community.jboss.org/people/amizzo] created the discussion

"Re: Error "Timeout trying to lock table 'PROCESSINSTANCELOG'""

To view the discussion, visit: https://community.jboss.org/message/821060#821060

--------------------------------------------------------------
Finally I understood why we receive this error.
The script task should not sleep. If you need to process some time consuming task, you should register your own workitemhandler (through the session.template file).

Something like the following:



public class MizzoTaskHandler  implements WorkItemHandler {
  private WorkItemManager workItemManager;
  private WorkItem workItem;
  private long workItemId;
  private Map results;
  private StatefulKnowledgeSession ksession;


  public MizzoTaskHandler(StatefulKnowledgeSession ksession){
    this.ksession = ksession;
  }

  public void executeWorkItem(WorkItem workItem, WorkItemManager workItemManager) {
    this.workItemId = workItem.getId();
    this.workItemManager = workItemManager;
    this.workItem = workItem;
    System.out.println("exec:" + workItemId);
    results = new HashMap();
    Thread th=new Thread(){
      public void run(){
        results.put("testWH",testleggiQ());
        ksession.getWorkItemManager().completeWorkItem(workItemId,results);
      }
    };
    th.start();
  }


  public void abortWorkItem(WorkItem workItem, WorkItemManager workItemManager) {


  }


  public void completeWorkItem() {
    workItemManager.completeWorkItem(workItemId, results);
  }
  public static String testleggiQ() {
    QueueConnection jmsConnection = null;
    QueueSession jmsSession = null;
    MessageConsumer receiver = null;
    try {
      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");


      env.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");


      InitialContext iniCtx = new InitialContext(env);
      Object tmp = iniCtx.lookup("ConnectionFactory");
      QueueConnectionFactory tcf = (QueueConnectionFactory)tmp;
      jmsConnection = tcf.createQueueConnection();


      // jmsConnection.setClientID((String)contextResources.get("JMS_CLIENT_ID"));
      Queue qu = (Queue)iniCtx.lookup("queue/testQIn");
      jmsSession = jmsConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      receiver = jmsSession.createConsumer(qu);
      jmsConnection.start();
      TextMessage msg = (TextMessage)receiver.receive();


      return msg.getText();
    }
    catch (Exception ex) {
      ex.printStackTrace();
    }
    finally {
      try {
        if (receiver != null)
          receiver.close();
        if (jmsSession != null)
          jmsSession.close();
        if (jmsConnection != null)
          jmsConnection.close();
      }
      catch (Exception ex2) {
        ex2.printStackTrace();
      }
    }
    return "";
  }
}
--------------------------------------------------------------

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

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