-
1. Re: instance not of expected entity type: org.jbpm.graph.def
ralfoeldi Jan 24, 2006 9:33 AM (in response to ralfoeldi)I've isolated the problem.
Just creating the Queryselect pl from org.jbpm.logging.log.ProcessLog as pl where pl.token = :token order by pl.index
(this is from LoggingsSession.findLogsByToken() ) already throws a HibernateException: instance not of expected entity type: org.jbpm.graph.def.Action. So data isn't the problem. I don't even get that far.
Still gratefull for any hints.
Rainer -
2. Re: instance not of expected entity type: org.jbpm.graph.def
ralfoeldi Jan 24, 2006 11:04 AM (in response to ralfoeldi)This one was bizarr!
Hibernate does an autoflush when createQuery is called (I don't know if this always happens but in this case it did and to find out I had to trace 15 stacklevels of Hibernate code)
As I have some 'transient' objects in the current processInstance (I remove them before persisting, see Thread on RuntimeActions) this caused the excpetion. Setting session.setFlushMode( Commit ) did the trick.
Rainer -
3. Re: instance not of expected entity type: org.jbpm.graph.def
koen.aers Jan 24, 2006 1:45 PM (in response to ralfoeldi)Rainer,
You are truely a champion in solving your own problems! Anyway it is great that you keep us posted on your struggles.
Thanks a lot and regards,
Koen -
4. Re: instance not of expected entity type: org.jbpm.graph.def
tom.baeyens Jan 24, 2006 3:22 PM (in response to ralfoeldi)by default hibernate will flush before it executes a query. that is normal cause the modified data related to your session could be involved in the query. and the query is executed in the db. that's why hibernate has to flush at query time.
anyways. some very impressive digging !
is there anything we could do in the jbpm code to handle this situation ?
regards, tom. -
5. Re: instance not of expected entity type: org.jbpm.graph.def
ralfoeldi Jan 24, 2006 6:01 PM (in response to ralfoeldi)Hi guys,
sorry for the panic, but I was working against the clock and willing to take any humiliation connected with stupid questions :-) Speed was all that mattered.
What surprised me was that it was tested code that threw up this problem. I was just playing around with some very rare scenarios in the lull before final deployment and all of a sudden it goes doom! I haven't yet figured out what caused the change (and it wasn't realy a priority.)
No there is nothing you should(!) do in jBPM code as the flushing is correct behaviour if you take 2 minutes to think about it, but thanks for asking. The root cause of the problem was my 'magic' adding transient runtime actions to the processInstance on the fly. I remove all instances + the corresponding logs before saving the processInstance, but that wasn't enough or rather soon enough in this case.
You missed out on a case of beer though. That would have been the next level of coaxing :-)
Greetings
Rainer -
6. Re: instance not of expected entity type: org.jbpm.graph.def
koen.aers Jan 25, 2006 4:52 AM (in response to ralfoeldi)"Rainer" wrote:
sorry for the panic, but I was working against the clock and willing to take any humiliation connected with stupid questions :-)
I would say you deserve bonus points instead of humiliation ;-)
Cheers,
Koen -
7. Re: instance not of expected entity type: org.jbpm.graph.def
koen.aers Jan 25, 2006 4:55 AM (in response to ralfoeldi)"Rainer" wrote:
You missed out on a case of beer though.
This is a pity though... Our thirst is legendary ;-)