Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: Waiting for Triage
-
Component/s: Core:DI
-
Labels:None
-
Last commented by a User:true
Description
so one of the problems, I'm looking at with logging, is the idea, that a request doesn't imply a transaction, and a transaction doesn't imply a request. I'd like to have my scope eagerly instantiated if either begins, the ideally they would share that bean until the last scope ended. That might be hard though... might be easier to create a different bean for each scope.
@Bean @Scope("transaction") @Scope("request") static CloseableThreadContext.Instance requestContext( @Value( "${dex.environment}" ) String env, String hostname ) {// spring will close CloseableThreadContext.Instance ctx = CloseableThreadContext.put( "env", env ); ctx.put( "hostname", hostname ); return ctx; }
Attachments
Issue Links
- relates to
-
SPR-17157 eager @Scoped beans
-
- Open
-