I have been experiencing thread safety problems with the Pages component (this is Seam
2.0.0 GA). This has been occurring when running load tests against our application. The
basic symptom is that Page actions are not executed and a quick look shows that the Page
object does not have any Actions, even though they are configured as such in pages.xml.
What I've discovered is that the seam debug mode definitely makes these errors more
frequent, because the Pages component is reinitialized each request. However even if this
is turned off, if several requests come in simultaneously after deployment and each
attempts to access/initialize the Pages component, quite frequently Page objects will end
up with an empty Actions list. Since this is true even when debug is turned off, it is a
risk to any application.
It appears that this is the same basic issue as reported in JBSEAM-2447, although I think
the fact that requests are coming in before the app is deployed just causes them to queue
up and they are probably all handled simultaneously once the deployment is complete.
However you can also wait for the application to deploy completely and then hit it with
multiple requests and get the same result. Would you like me to update that issue with
more information or add a new one?
I spent some time looking at the Pages initialization code and I couldn't figure out
where this race condition came from. As far as I can tell, the fact that multiple Pages
objects are being instantiating and each is parsing the pages.xml should be OK. They
don't appear to be sharing data. I'd assume that they would all end up being
initialized correctly and the last one would "win" and get set in the context.
As far as I could tell from reading the code and watching in the debugger, each instance
creates a Document from parsing the pages.xml file and then iterates over the Elements to
create an object graph with Pages and Actions. This looks like it would be fine, however
I can also put in a breakpoint that will clearly show the Page.actions ArrayList being
empty when it shouldn't be. Perhaps someone more familar with the Pages component
might have a guess at where to look?
Thanks,
Kahli
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118125#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...