-
1. Re: Multiple sessions and thread safety using jBPM persistence
swiderski.maciej Nov 2, 2012 7:00 AM (in response to jasonjho)Recently an issue was resolved that looks like you could ran into - when same process instance is manipulated by two sessions optimistic lock exception (StaleObject...) can be seen as persistence context was not cleared on transaction end meaning cached object was used on next command execution. It was fixed in 5.4 so soon should be available as Final, meanwhile you could give a try with CR1.
HTH
-
2. Re: Multiple sessions and thread safety using jBPM persistence
jasonjho Nov 2, 2012 1:53 PM (in response to swiderski.maciej)Hi, thanks for the reply/info.
1) Do you know if the 5.4.0CR1 build is compatible with Drools 5.3.1.Final?
2) Are other JPA providers such as OpenJPA supported with the 5.4.0.CR1 build? I know from previous JIRA reports that Hibernate was the only one that was supported at the time of 5.2.0.
Thanks!
-
3. Re: Multiple sessions and thread safety using jBPM persistence
swiderski.maciej Nov 2, 2012 2:20 PM (in response to jasonjho)Jason J wrote:
Hi, thanks for the reply/info.
1) Do you know if the 5.4.0CR1 build is compatible with Drools 5.3.1.Final?
as far as I can tell it is not
Jason J wrote:
2) Are other JPA providers such as OpenJPA supported with the 5.4.0.CR1 build? I know from previous JIRA reports that Hibernate was the only one that was supported at the time of 5.2.0.
not yet, work is in progress, there are jira issue for it so please keep an eye on them and vote to speed up the work
HTH
-
4. Re: Multiple sessions and thread safety using jBPM persistence
jasonjho Nov 3, 2012 3:52 PM (in response to swiderski.maciej)Hi Maciej,
Could you point me to the bug report regarding the 2 sessions and StaleObjectException? At this point, I'm wondering if it's simple enough to patch this fix into my current environment instead of upgrading to a new version (i am running into other new issues that i'm not seeing in my current build).
Thanks!
-
5. Re: Multiple sessions and thread safety using jBPM persistence
jasonjho Nov 3, 2012 6:02 PM (in response to jasonjho)Finally tracked it down. For anyone that is in a similar situation, the fix is:
In SingleSessionCommandService.SynchronizationImpl.afterCompletion(...), add the following line and update the interfaces accordingly
this.service.jpm.clearPersistenceContext(); // clears the context after tx complete
this.service.jpm.endCommandScopedEntityManager();