0

My question come because I'm working in high available system and That have struts2 and I want to know if,Is the map of SessionAware interface implemented in Actions is a thread safe object?

any way why?

erod
  • 181
  • 1
  • 17
  • 1
    perhaps this might have some additional references https://stackoverflow.com/questions/17812406/struts-2-sessionmap-not-synchronized – jspcal Sep 01 '22 at 00:10
  • I have been working with struts2 for a long time and I did not have problems with concurrency in my session until now , but I want to make sure of that, thanks for your comment @jspcal – erod Sep 01 '22 at 00:19
  • 1
    See the source of `SessionMap`. Roughly speaking, yes, and it's created per-request. Are you spinning up intra-request threads that modify the session? If not, the question isn't relevant. If so, that's interesting; haven't had to do that ever. – Dave Newton Sep 01 '22 at 14:56

1 Answers1

0

Well, after some tests and read docs struts 2 is an architecture as one instance is create each time that recibe a request, in fact sessionAware interface declare a standar map that we can implements in ours action, and the data is store in that map is send from server to client and client to server and of this manner we can keep session data.

erod
  • 181
  • 1
  • 17