Skip to content

Unable to pass RequestContext to Runnables #54

@MorganMaison

Description

@MorganMaison

We have to create and launch runnable tasks that must access several of our DAOs.

The problem is that inside theses DAOs, part of our logic is based on pieces of information stored in the RequestContext. Because the WebController is binding threads with their given RequestContext, (using a ThreadLocal) we are unable to retrieve it in a runnable (ie. another thread).

It make sense: because no WebRequest created this thread directly, how could it have a RequestContext ? The problem is that it prevent us from using the rest of our logic inside the runnable.

To help us pass around a context, it would be nice to have in Snow something similar to Guice's ServletScopes.transferRequest() in CurrentRequestContextHolder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions