Active objects in Jira Data Center

In my plugin, I am using an active object to store data. From UI I am entering some inputs and based on the inputs I am adding data to the active object. Before adding the data, I am checking if the data is present. If not, then create the data in the active object. Now in the data center environment, when two users enter the same input, according to my logic, it is creating duplicate entries in the active object.
How should I avoid this scenario? I referred the atlassian documentation https://developer.atlassian.com/server/jira/platform/developing-for-high-availability-and-clustering/.
I am not sure which to use. Any suggestion will really helpful.

I believe you shall use ClusterLockService (see the same page you have referenced). When you use it on server version it has JVM implementation and when it is in DC you get a cluster-wide lock service.

2 Likes