In my spring-jdbc project i have a class called DBStuff which i use to connect to db and make simple db operations. It's a web project and there are users, so naturally i use session mechanism. When i need to retrieve request data in DBStuff class, i use this line of code below :
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
But, there is no explanation that if the RequestContextHolder is thread-safe or not. Even the spring's official forum doesn't have an answer for that. Because of using servlet, i need to provide a thread-safe nature for the users.
By definition RequestContextHolder is defined as "Holder class to expose the web request in the form of a thread-bound RequestAttributes object." But i am not sure if "thread-bound" stands for thread-safe.