[jboss-user] [JBoss jBPM] - Unable to close jbpmContext - help !

francis1970 do-not-reply at jboss.com
Mon Jan 28 05:31:34 EST 2008


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

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

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



More information about the jboss-user mailing list