Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 75E7A7671 for ; Tue, 20 Sep 2011 14:46:30 +0000 (UTC) Received: (qmail 43456 invoked by uid 500); 20 Sep 2011 14:46:30 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 43423 invoked by uid 500); 20 Sep 2011 14:46:30 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 43414 invoked by uid 99); 20 Sep 2011 14:46:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2011 14:46:30 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2011 14:46:29 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D9AFEA485C for ; Tue, 20 Sep 2011 14:46:08 +0000 (UTC) Date: Tue, 20 Sep 2011 14:46:08 +0000 (UTC) From: =?utf-8?Q?Florian_M=C3=BCller_=28JIRA=29?= To: dev@chemistry.apache.org Message-ID: <617685453.46367.1316529968888.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <215372227.45578.1316514069332.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CMIS-432) AbstractCmisService is not thread safe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CMIS-432?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D131087= 50#comment-13108750 ]=20 Florian M=C3=BCller commented on CMIS-432: ------------------------------------- See also http://chemistry.apache.org/java/developing/dev-server.html > AbstractCmisService is not thread safe > -------------------------------------- > > Key: CMIS-432 > URL: https://issues.apache.org/jira/browse/CMIS-432 > Project: Chemistry > Issue Type: Improvement > Components: opencmis-commons > Affects Versions: OpenCMIS 0.5.0 > Reporter: Carlo Sciolla > Labels: concurrency, multithread, thread-safety > > The use of an unsynchronized HashMap for storing AbstractCmisService.obje= ctInfoMap (see AbstractCmisService.getObjectInfoMap) makes it inherently th= read unsafe. When extending that class, we ran in busy waits on HashMap.get= , which we fixed overriding the following two methods to which we added the= {{syncronized}} bit: > {code:java} > @Override > public synchronized ObjectInfo getObjectInfo(String repositoryId, Str= ing objectId) { > return super.getObjectInfo(repositoryId, objectId); > } > @Override > public synchronized void addObjectInfo(ObjectInfo objectInfo) { > super.addObjectInfo(objectInfo); > } > {code} > It would still be nice if thread safety is provided by the library itself= without the need for external synchronization. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira