You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2006/08/08 09:19:34 UTC
[1.4] ResourceType.setSampleURI() and thread safety
Hi Lenya devs,
I just noticed that the ResourceType interface has got a
method setSampleURI(). When I created the ResourceTypeImpl
class, I declared it as ThreadSafe, because that was no problem
at this time.
In case you're not familiar with concurrency issues, imagine
the following scenario:
- user A starts the creation process for ResourceType xhtml
- user A selects the sample "foo"
- xhtml.setSampleURI("foo") is called
- in the same second, user B starts the creation, but wants
to use the sample "bar"
- xhtml.setSampleURI("bar") is called
- since the ResourceType is a singleton, A's document is
also created using the sample "bar"
IMO the resource type should be rather stay ThreadSafe and we
should remove the setter method. Actually, I don't know why
it should be necessary. I'll refactor the code accordingly.
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org