How can I cache a current User instance for the duration of an entire user session, so that my services can access it freely without having to go to the user access services and then fetch the user data from the database over and over again.
I know that Spring supports the concept of scoped beans (per session, per request, etc), but honestly speaking, I have never actually used it, so I would be very thankful if someone could show me the way.
I am highly hopeful that this sort of session scoping is thread safe.
Spring is not the solution for everything. HttpSession is what you need. And session scoping is not thread-safe.