Issue Type: Bug Bug
Affects Versions: 1.1.8.Final
Assignee: Unassigned
Components: Scopes & Contexts
Created: 26/Jun/12 12:31 PM
Description:

SessionScoped Producers are called multiple times in the same session if a second request in the same session comes before the first one finishes.

The first request is thus processed with an outdated instance, as it will be replaced by the produce of the other request.

public class ShoppingCartProducer
{
   private static AtomicInteger ai = new AtomicInteger();
   
   @Produces
   @SessionScoped
   public ShoppingCart getShoppingCart() {
      System.out.println("getShoppingCart producer");
      
      try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); }
      
      return new ShoppingCart("cart" + ai.incrementAndGet());
   }
}
Environment: JBoss AS 7.1.2.Final
Project: Weld
Priority: Major Major
Reporter: Marek Schmidt
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira