Concurrency error when using Rally WSAPI
search cancel

Concurrency error when using Rally WSAPI

book

Article ID: 77114

calendar_today

Updated On:

Products

Rally On-Premise Rally SaaS

Issue/Introduction

When writing integrations that perform numerous simultaneous transactions or many transactions in rapid succession, a transaction may fail with a concurrency exception.  These errors may be seen even though the HTTP status code is 200 (the status of 200 just means at the protocol level everything went fine passing the information back and forth, but our application may not have liked something - which will be returned in the errors section). 

The error returned may appear as follows:

"Concurrency conflict: [Object has been modified since being read for update in this context] - ConcurrencyConflictException : Modified since read on update : Object Class : com.f4tech.slm.domain.Subscription : ObjectID : 100000001"

or it may appear as the following

"Could not update: Could not write changes in Unit Of Work"

 

Cause

This issue is frequently seen in multi-threaded applications where the external application is sending multiple update requests at the same time.

This is not an issue with the newly created or modified object being updated, but usually more related to synchronization of data between application servers in our cluster.  Editing the same object at the same time can cause this, as could revising a two objects that performs a cascade update to the same parent/child.

Resolution

This can be mitigated by the following suggestions: