cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti job executors in a clustered environment

peter_spikings
Champ in-the-making
Champ in-the-making
Hi,

I've got a two node back-end cluster driven by Activiti (front-ends start processes and the back-ends poll for activities they can process). All good but soon I'm going to be wanting to have timer start events. I'd like to enable the job executor on both but wouldn't want both of the back-ends to start a process for obvious reasons.

I read a forum post from early last year where it was claimed this was possible and would be documented very soon but I can't find the documentation. Would I be OK to do this?

Thanks,

Peter.
6 REPLIES 6

peter_spikings
Champ in-the-making
Champ in-the-making
Bump

frederikherema1
Star Contributor
Star Contributor
Thanks for the reminder, Ronald.

The job-executors can run concurrently. When they both acquire the same job, one of them will get an optimistic-lock exception when executing the timer and will roll back.

peter_spikings
Champ in-the-making
Champ in-the-making
Thanks for the reminder, Ronald.

The job-executors can run concurrently. When they both acquire the same job, one of them will get an optimistic-lock exception when executing the timer and will roll back.

Excellent, I suspected as much, just wanted to confirm!

Thanks for the help,

Peter.

slash117
Champ in-the-making
Champ in-the-making
hello,
I have the same situation on my production platform. I was wondering if its not better to use a lock based on the database ("select from 'specificLockTable' for update" in the beginning of the transaction used by the jobExecutor) than to catch the OptimisticLockingFailure Exception. This way we ensure that no concurrent access happens when different jobExecutors are executed.

Regards,
Gilbert E.H.

trademak
Star Contributor
Star Contributor
Hi,

What's the issue with the current implementation? When you have multiple job executors, only 1 will execute a job as the job is locked in the database. Another job executor will give an OptimisticLockException. So what's wrong with that?

Best regards,