1 Reply Latest reply on Feb 26, 2006 4:31 PM by jdirksen

    ObjectNotFoundException while deleting instance

    jdirksen

      I want to be able to delete processes that have finished or are in an unrecoverable state. I thought this would just be easy just by using:


      JbpmContext ctx = JbpmConfiguration.getInstance().createJbpmContext();
       try {
       ProcessInstance inst = ctx.loadProcessInstance(id);
       ctx.getGraphSession().deleteProcessInstance(inst);
       }
       finally {
       ctx.close();
       }


      But this doesn't seem to work. When I do this it results in this:

      org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.jbpm.graph.exe.ProcessInstance#2708]
       at org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
       at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:65)
       at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:98)
       at org.hibernate.impl.SessionImpl.bestGuessEntityName(SessionImpl.java:1701)
       at org.hibernate.impl.AbstractQueryImpl.setEntity(AbstractQueryImpl.java:564)
       at org.jbpm.db.GraphSession.deleteProcessInstance(GraphSession.java:329)


      Any idea what I might be doing wrong? It's strange that I can load the instance, but I can't delete it.

      Hope someone can help me with this.

        • 1. Re: ObjectNotFoundException while deleting instance
          jdirksen

          Well just ignore my post. I've just checked what's stored in the database, and the process instance really isn't there.

          From my UI I passed in the id of the process definition not of the instance I was trying to delete.

          Keep up the great work, it's been really interesting integration jBpm into our current project, good intuitive API and well working library.