title: worklight adapters, session variables: do multiple requests race?
body: <p>Question is: are adapters thread-safe?</p>
  
  <p>We know that adapters can have session variables, so that state created by one call from a client is accessible on a subsequent call (assuming session affinity if we are using a cluster). An example <a href="https://stackoverflow.com/questions/16335815/ibm-worklight-session-control-with-back-end-server">question/answer</a> here confirming that.</p>
  
  <p>Given that client code is making asynchronous calls to adapters it's clearly possible for a client to issue multiple simultaneous requests to an adapter and hence there is a potential for a race condition between two such requests hitting the same session variables.</p>
  
  <p>I see two possibilities (ignoring for the moment the issue of consistency between cluster members):</p>
  
  <p>The Worklight Server might permit parallel requests to run in separate threads in which case if the session state variables have the potential for material inconsistency synchronisation will be required and we need to use Java constructs or a database to achieve whatever thread-safe logic we must implement.</p>
  
  <p>The Worklight Server might queue requests for a session hence Adapters are thread safe (within a single process) and hence our code is somewhat simpler.</p>
  
  <p>What does Worklight promise?</p>