Defect #1961
closedOccasional duplicated automatic role assignment
100%
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
Related issues
Updated by Petr Michal about 5 years ago
- File auto_roles_error.png auto_roles_error.png added
Updated by Radek Tomiška about 5 years ago
- Status changed from New to In Progress
Updated by Radek Tomiška about 5 years ago
- % 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.
Updated by Radek Tomiška about 5 years ago
- Related to Task #1968: Prevent to try assign duplicated automatic roles added
Updated by Radek Tomiška about 5 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Radek Tomiška to Vít Švanda
- % Done changed from 30 to 90
Constraint added, tested on all supported databases, commit:
https://github.com/bcvsolutions/CzechIdMng/commit/7103879e6a4e1fee4b1b8a673b7c31676a088423
Could you do a feedback, please?
Updated by Vít Švanda about 5 years ago
- 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.
Updated by Radek Tomiška about 5 years ago
- Status changed from Resolved to Closed
Updated by Radek Tomiška almost 5 years ago
- Related to Defect #1840: Duplicities in processed automatic roles and processed items from LongRunningTask added
Updated by Radek Tomiška over 4 years ago
- Related to Defect #2305: Automatic role by tree structure: contract and position cannot assign the same automatic role added