-
1. Re: jBPM Process Persistence Issue
vmdocua Sep 30, 2011 3:32 AM (in response to trjiii)Hello Thomas,
This might be problem related to JBPM5 persistence mechanism design, things like ProcessInstanecInfo, WorkItemInfo serialized automatically by JPA. On long transaction it's possible that JPA+Hibernate flushes objects from JBPM session to DB and mark this object as pesisted. Then JBPM code still continue to modify objects (process info, workitem info, logs etc), but these updates don't affect JPA session, so applying to JPA this object is not modified anymore. This is caused by specific design/implementation for presistance in JBPM.
If this is case - as temporary solution provide own EntityManagerFactory implementation and for each created EntityManager set "EntityManager.setFlushMode(FlushModeType.COMMIT)". This will prevent intermediate flushes and delay all JBPM/JPA persistence to DB calls to transaction commit time.
--
Thanks,
Vadim.
-
2. Re: jBPM Process Persistence Issue
marco.rietveld Sep 30, 2011 11:42 AM (in response to trjiii)Which database are you using? (or are you just using the defaul h2 configuration?)
-
3. Re: jBPM Process Persistence Issue
vmdocua Oct 1, 2011 4:41 PM (in response to marco.rietveld)Hello Marco,
I belive mentioned problem is not related to DB at all and should exist on many DBs. We saw this on DB2 UDB 9. Problem roots reside in JPBM5 persistence mechanism design, it should be reviewed and reworked, palliative solution to bypass this provided above. ORM works with entities like processinstanceinfo (XXXinfo), but there is no correlation between real process runtime info and serialized XXXinfo. Once XXXinfo is serialized by ORM, it will not be serialized anymore even if related process was updated. In 90-99% cases nobody see this problem, as in JBPM5 demo, presentation and tutorial code transaction is simple and commit happens at the end, when all JBPM5 execution finished and all is good. In real business application and large transaction it's possible that Hibernate sometime flushes data to DB in the middle of JTA transaction. This intermediate snapshot will contain old/broken information about process instance. Later, at the JTA transaction commit time latest process instance information will not be serialized to DB anymore.
--
Thanks,
Vadim.
-
4. Re: jBPM Process Persistence Issue
trjiii Oct 3, 2011 8:50 AM (in response to marco.rietveld)I am experiencing this problem on DB2 express currently.
-
5. Re: jBPM Process Persistence Issue
trjiii Oct 3, 2011 8:51 AM (in response to vmdocua)Thanks Vadim! I will give this a try and see if it helps this problem. Thanks again for the information!
-
6. Re: jBPM Process Persistence Issue
trjiii Oct 21, 2011 6:16 PM (in response to trjiii)I figured this out. Had to remove the TransactionFactory_factory property from Hibernate and also wrap in a userTransaction.begin() and .Commit()
-
7. Re: jBPM Process Persistence Issue
salaboy21 Oct 21, 2011 6:20 PM (in response to trjiii)hmm instead of doing that you should configure with hibernate the transaction manager provided by websphere if not you are doing something that it should be a container responsability. Of course that it will work but be ready for complications in the future.
Cheers