You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2010/03/02 19:03:27 UTC

[jira] Created: (OWB-315) cache resolved instances in NormalScopedBeanMethodHandlers of @SessionScoped beans

cache resolved instances in NormalScopedBeanMethodHandlers of @SessionScoped beans
----------------------------------------------------------------------------------

                 Key: OWB-315
                 URL: https://issues.apache.org/jira/browse/OWB-315
             Project: OpenWebBeans
          Issue Type: Improvement
    Affects Versions: M4
            Reporter: Mark Struberg
            Assignee: Mark Struberg
             Fix For: 1.0.0


contextual instances of a @SessionScoped bean may get cached as long as the context refers to the same sessionId as:

private ThreadLocal<WeakReference<?>> instanceCache;

If the sessionId changes (for the current thread), then we need to refresh the cache

Usecase:

public @SessionScoped class UserSettings {
  private Locale locale;
  ...
}

public @ApplicationScoped class MyService {
  private @Inject UserSettings us;
  ...
}

In this case the contextual reference (proxy) which gets injected in variable 'us' doesn't need to reload the contextual instance from the central context, but only if the sessionId of the current thread changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OWB-315) cache resolved instances in NormalScopedBeanMethodHandlers of @SessionScoped beans

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gurkan Erdogdu closed OWB-315.
------------------------------

    Resolution: Fixed

> cache resolved instances in NormalScopedBeanMethodHandlers of @SessionScoped beans
> ----------------------------------------------------------------------------------
>
>                 Key: OWB-315
>                 URL: https://issues.apache.org/jira/browse/OWB-315
>             Project: OpenWebBeans
>          Issue Type: Improvement
>    Affects Versions: M4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.0.0
>
>
> contextual instances of a @SessionScoped bean may get cached as long as the context refers to the same sessionId as:
> private ThreadLocal<WeakReference<?>> instanceCache;
> If the sessionId changes (for the current thread), then we need to refresh the cache
> Usecase:
> public @SessionScoped class UserSettings {
>   private Locale locale;
>   ...
> }
> public @ApplicationScoped class MyService {
>   private @Inject UserSettings us;
>   ...
> }
> In this case the contextual reference (proxy) which gets injected in variable 'us' doesn't need to reload the contextual instance from the central context, but only if the sessionId of the current thread changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.