REST resources are not thread-safe, but shared by concurrent thread because of
Spring
-------------------------------------------------------------------------------------
Key: GEOS-4179
URL: http://jira.codehaus.org/browse/GEOS-4179
Project: GeoServer
Issue Type: Bug
Components: REST
Affects Versions: 2.0.x, 2.1.x
Reporter: Martins Linde
Assignee: Andrea Aime
Priority: Critical
Restlet resources are not designed to be thread-safe (response, request are
stored in fields... ), but BeanResourceFinder method findTarget:
public Resource findTarget(Request request, Response response){
Resource res = (Resource) applicationContext.getBean(getBeanToFind());
res.init(getContext(), request, response);
return res;
}
returns the same Resource instance to concurrent threads (Spring returns the
same instance),
workaround is to tell Spring to give different instances, that can be done with
scope="prototype" like:
<bean id="xResource" class="x.xResource" scope="prototype"/>
But it would be nice if it could be fixed in code not in the Spring
configuration file, because users may forget to add scope attribute, which may
lead to real time errors.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel