Hello, I've a problem in a method that advance in a definition process for the 
indicated transition. The method is the following:


  | private void goTo(Long id_instance, String transition) {
  |             try {
  |                     ProcessInstance 
instance=getJbpmContext().loadProcessInstanceForUpdate(id_instance);            
  |                     if(!instance.isTerminatedImplicitly()){
  |                             Token token=new Token(instance);
  |                             token.signal(transition);
  |                             
  |                             jbpmContext.save(token);
  |                             jbpmContext.save(instance);
  |                     }
  |             } catch (RuntimeException e) {
  |                     e.printStackTrace();
  |             }finally{
  |                     jbpmContext.close();
  |             }
  |     }
  | 

And the exception is.


  | 12:40:42,078 ERROR [DbPersistenceService] hibernate commit failed
  | org.hibernate.TransientObjectException: object references an unsaved 
transient instance - save the transient instance before flushing: 
org.jbpm.graph.exe.Token
  |     at 
org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
  |     at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
  |     at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:242)
  |     at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:597)
  |     at 
org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3123)
  |     at 
org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:479)
  |     at 
  | ....
  | 

How could do I fix it?? Because I save both, token and instance. I tried only 
to save the instance but it didn't work.

Thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201715
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to