Defect #1961
closed
Occasional duplicated automatic role assignment
Added by Petr Michal about 5 years ago.
Updated about 5 years ago.
Description
Sometimes automatic role assignment is duplicated (probably it only happens with roles for attributes).
From this duplication automatic roles feature does not work. The problem occurs randomly in weeks.
Also there is a chance that the problem is due to project implementation.
Files
- Status changed from New to In Progress
- % Done changed from 0 to 30
The duplicated assigned role is cretated by two scheduled LRT:
- SelectCurrentContractSliceTaskExecutor - publishes NOTIFY event for the contract => asynchronous automatic roles recount is called
- ProcessAllAutomaticRoleByAttributeTaskExecutor => synchronous automatic roles recount is called.
If the first asynchronous attempt to add automatic roles is executed after the second, but synchronous, attempt => duplicity is created.
Workaround for this issue is switch order of procesing of this LRT => ProcessAllAutomaticRoleByAttributeTaskExecutor should be scheduled before SelectCurrentContractSliceTaskExecutor.
Final solution, which will not depend on the schedule above:
- constraint will be added directly into database (referential integrity) - this will prevent to create duplicate.
- Redesign both task to be synchronous or asynchronous (both LRT cannot process one resource in the same time) - whis will prevent to attempt create duplicate.
- Related to Task #1968: Prevent to try assign duplicated automatic roles added
- Status changed from In Progress to Needs feedback
- Assignee changed from Radek Tomiška to Vít Švanda
- % Done changed from 30 to 90
- Status changed from Needs feedback to Resolved
- Assignee changed from Vít Švanda to Radek Tomiška
- % Done changed from 90 to 100
I did review and unique constraint was created successfuly. Thanks for that.
- Status changed from Resolved to Closed
- Related to Defect #1840: Duplicities in processed automatic roles and processed items from LongRunningTask added
- Related to Defect #2305: Automatic role by tree structure: contract and position cannot assign the same automatic role added
Also available in: Atom
PDF