Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
elelik
Contributor
Contributor

Rest webservice context variables issue

Hi,
I create Rest Webservice and on the other side of tRestRequest component i have Context variables in a tJavaFlex component to pass data, everything work perfectly when it receives a request.
But when the webservice receives more than one request at the same time, while the first request is processing, the following request modified the current context variables value which throw an exception.
 
I spend hours to find a solution, but nothing
 
if anyone have an idea, i'll be please if you share it
 
thx
Labels (4)
3 Replies
Anonymous
Not applicable

Hi elelik,
Try replacing the context variables with globalMap variables. globalMap variables should be thread safe, so you shouldn't get this problem.
To set a globalMap variable, do the following.....

globalMap.put("my variable name", "my value");

 To retrieve the value (in this case a String), do the following...
String myVar = ((String)globalMap.get("my variable name"));
elelik
Contributor
Contributor
Author

Hi rhall_2.0,


thanks for reply, but i am using context variables because i have to pass data to a tRunjob component. How can i do this no using context variables, globalMap variables are not usables for this.

Thx
Anonymous
Not applicable

The tRunJob will receive the values as context variables, but you can supply them as globalMap variables. If the problem is that the tRunJob component is not thread safe, then I believe that to be a bug.