Announcement Announcement Module
Collapse
No announcement yet.
Sharing Session scope objects across threads Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sharing Session scope objects across threads

    Hi everybody,

    I'm a bit on unfamilar grounds, so if my question is not submitted at the right place, please let me know...

    I am running a spring-mvc application, using session level beans being injected to singleton objects, using the <aop:scoped-proxy> setting in my application context.
    I have a thread pool in the application that provides pre-spawned threads. These thread-pool threads are used by standard managed-application-server threads. The standard threads are indeed being injected with the session objects. I was wondering if there's a way to tell spring to perform the bean injection for the context of the threads in the thread pool as well (so before thread A runs thread B it could tell spring to treat it with the same session context. That way the session-level objects would be accessible from both threads).

    Thank you for your help!
    shahar

  • #2
    Not sure that is possible. The problem is that http session is bounded to a particular thread. If you open a new thread (or use a preexisting one), there is no session bounded to it. The only solution I can think about, would be to pass the data directly to the threads (Unproxied)

    Comment

    Working...
    X