title: Spring boot Class Behaviour
body: <p>I am using Spring boot. I have some question regarding the singleton behaviour of spring boot beans. I am using beans which are singleton. So they will have only one instance per application.</p>
  
  <p>But doubt I have is that</p>
  
  <p>a) Application will create just 1 instance for each request OR application will create just 1 instance for all Requests ?</p>
  
  <p>b) I have create one Service &amp; one static variable in it. SO what is happening now is that in one request I am changing the value &amp; in another request, if am getting the variable, I am getting the changed values? Why is that?</p>
  
  <p>c) ALso same behaviour exists when the variable are not static, just normal class variable? Why is that?</p>
  
  <p>d) Also what would be the good way to store the data which is request specific e.g. Lets say in each request I generate transaction Id &amp; I want to use it in 10 different places in request. So how do I save it per request or do I have to pass it every where. Consider I have 1000 of requests per second. So obviously I can't set class level variables otherwise values will be overridden every time as beans are not thread-safe.</p>