-
Bug
-
Resolution: Done
-
Major
-
1.1.5.Final
-
None
When creating two or more conversation scoped beans, the creation of the second bean will block until any method annotated with @PostConstruct is finished.
In my example WAR project I have two JSF pages: one accesses a conversation scoped bean that sleeps for 10 seconds in a method annotated with @PostConstruct. The other accesses a conversation scoped bean that does not have any method annotated with @PostConstruct.
While the first page is loading, the second page will be unable to finish, because bean creation is blocked completely.
The lock seems to be acquired here:
https://github.com/weld/core/blob/1.1.5.Final/impl/src/main/java/org/jboss/weld/context/AbstractContext.java#L101
... and postconstruct is called here:
https://github.com/weld/core/blob/1.1.5.Final/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java#L291