Are the plain java client libraries thread-safe?
Marko Tomljenovic (316●50●109)
| asked Apr 16 '15, 4:17 a.m.
edited Apr 16 '15, 5:21 a.m. by Ralph Schoon (63.5k●3●36●46)
This is a copy of this thread "Is the pure java client thread-safe?"
Could you please anwer the question. The answer is very important for the design of our tool that we are developing against the RTC Plain Java API.
Content of referenced thread:
|
One answer
Ralph Schoon (63.5k●3●36●46)
| answered Apr 16 '15, 5:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As far as I can answer this question:
I have used threads to perform concurrent activity using the API, in a similar fashion as described above, and it has worked for me in the past. The RTC Eclipse client also uses multiple threads. You can run operations in the background and not all operations run in the UI thread. Ultimately the API accesses the Server at which level any of the operations is thread safe to an extent that concurrent operations would not break the data. All is done in transactions. That does not necessarily mean that the API does all the work for you. Read operations are not a problem as far as I can tell, provided you make sure your data is isolated across threads e.g. you don't read into memory that is shared across threads. If you update on the same items in parallel, you could get into situations that a thread wants to update data that is already changed. In this case you get a stale data exception. In this case you would have to resolve the data again and do the changes again. My 2 cents. Comments
Marko Tomljenovic
commented Apr 16 '15, 8:09 a.m.
Ok, thank you for your two cents! :)
That means it seems to work for some use cases (since you already did it) but there is not official document resp. statement from IBM development regarding this, right?
Marko
I have not seen an official statement. All the official information is in the API Doc JavaDoc.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.