-
1. Re: How to Manage Concurrency assigning a task
ralfoeldi Jan 26, 2006 9:29 AM (in response to claudio.masini)Hi Claudio,
I can't help you on the Task part but as soon as you have concurrency you would have to lock on processInstance anyway before executing anything.
The only reliable place to do that is in a database. Jbpm gives you GraphSession.lockProcessInstance() or use Hibernate directly. This will i.e. place a 'select for update' lock on the rows in your db (depends on Hibernate settings).
You will probably only want to do this for the time it takes to set your assignment correctly.
Does this help?
Greetings -
2. Re: How to Manage Concurrency assigning a task
claudio.masini Jan 27, 2006 4:58 AM (in response to claudio.masini)I will try to use org.hibernate.Session.lock(task, LockMode.UPGRADE) to see if this will solve the problem.
Locking the process instance give me the idea that it locks only that object.
I will let you know if it work.
Many thanks for the idea (I'm studying hibernate at the same time... so I'm pretty novice with it)
Thanks a lot
Claudio