AnsweredAssumed Answered

Duplicate groups created for multi  instance activity  on Keycloak synchronization

Question asked by cguttarlapalli on Nov 21, 2018

Hi ,

      iam running multi instance Activiti , using a single Keycloak server, single Mysql DB

      I have users and groups created in key cloak.

      My groups are nested to 3-4 levels.

      we are using full synchronisation , with cron job running every 2 min.

      When I  create a new group in key cloak  , the sync runs every 2  minutes as per cron config.

       The problem is my lowest level groups are getting duplicated in Activiti when the second instance calls the synchronisation process, My database is left with two duplicate groups on the lowest level.

 

The problem is two different threads insert the same data in a small time gap, we have no way to verify wats already in the database as the implementation is controlled by Activiti. 

 

one option I have is to add a unique constraint for name of group on the mysql db, its slightly awkward solution .

 

Can you please  suggest me  if there is any other way we can control this  behaviour?

Outcomes