1 Reply Latest reply on Jan 28, 2008 6:24 AM by Anurag Paliwal

    Unable to close jbpmContext - help !

    Frank Newbie

      Dear all,
      I have a web application which is front-end for a JBPM process.
      When a Task Node is reached, an assignment handler is fired.
      This simply persist some information on the DataBase to keep track of the assignment.

      The problem is that, when JbpmContext is closed() an exception is raised.....

      org.jbpm.JbpmException: problem closing services {persistence=org.jbp
      m.persistence.JbpmPersistenceException: hibernate commit failed}


      this is the code of the AssignmentHandler

      public class SimpleAssignmentHandler implements AssignmentHandler {
       private static final long serialVersionUID = 1L;
       public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception {
      
       assignable.setActorId("username");
      
       JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
       JbpmContext ctx = jbpmConfiguration.createJbpmContext();
      
       Session session = ctx.getSession();
       Query query = session.createQuery("from Test");
      
       Test test = (Test)(query.list().get(0));
      
       session.beginTransaction();
      
       test.setName("name");
       test.setSurname("surname");
      
       session.getTransaction().commit();
       session.close();
      
       ctx.close(); // Exception is raised here
       }
       }


      I'm using JBPM 3.2 deployed on JBoss 4.2.0.....
      Any ideas ? thanks a lot
      Francesco