hi,
Thanks for your replies.
I did not give particular details because I was trying to explain a usual
J2EE scenario (using Analogy to Struts action class and utility class).
It is true that unless and until I am using any shared object that is being changed in Utility Static method it wont give rise to threading concerns.
Let's say that the utility class has "getConnection" method that returns me a
JDBC connection using all method scoped code. It does not depend on anything other than parameters passed to method and local variables. Would it cause any issue in any way in multi-threaded scenario.
My understanding was
1) Action's execute method is executing in a particular thread (T1).
2) It calls Utility.getConnection() method
3) Some other thread(T2) gets the CPU and Utility.getConnection() is put aside.
4) T2 also has a call to method "Utility.getConnection()".
5) Now because the getConnection method is static, would it affect the part of the code earlier executed on account of Thread T1. ???
I have tried explaining my understanding and the doubt that I have above. Hope this helps to clarify my doubt.
Regads,
Amit