-
Bug
-
Resolution: Done
-
Major
-
1.1.8.Final, 2.0.0.Alpha2
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()); } }