has nobody a hint for me?
Bernd, how about updating the database directly? By using reflective access you are most probably bypassing the bytecode enhancement.
i don't know about the reflection problem. the way you code it should be ok. if you started from processInstance.getClass().getDeclaredMethod(...) then you could have a problem that you had to solve by searching the super classes recursively.
direct db access should not be necessary.
maybe it is because the hibernate proxy is not yet initialized. try initializing explicitely with Hibernate.initializeProxy or somthing like that. maybe the proxies have a cache of all the members... what happens when you save the process instance ?
you could also add a jira issue to ask for a setter on the version.
The hibernate proxy object can be got at this way:
Session session = jbpmSession.getSession(); Serializable identifier = jbpmSession.getSession().getIdentifier(processInstance); Object proxy = session.get(ProcessInstance.class, identifier);
But what if anything can be done with that I'm not sure. I tried setting fields in the proxy object with no success. I'm really new at hibernate, but I would think there should be some way to set arbitrary fields of a proxied object, as long as it's a hibernate-managed mapping.
I'm thinking maybe a net.sf.hibernate.Interceptor could work for this problem?