I have a spring bean Lets us say BeanA and scope is default injected via constructor.I have instance variable c which i am not using and its getting used in method1 and method2.Note that C is not injected.But in multithreaded environment I am facing issues because of variable C .As i unserstand default scope is singleton so this should work? The issues are like when diffrent users are trying to access the bean at same time They are getting stale instance of c Like example let user 1 instantiate c = hello .user 2 is seeing same hello.I want to understand how instance variable behave if not injected and used in diffrent methods?
class BeanA{
private A a,
private B b;
private C c;
public BeanA( A a, B b){
this.a=a;
this.b=b;
}
public method1(){
c= //assignSomething
}
public method2(){
c= //assignSomethingElse
}
}