You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2006/12/19 10:00:21 UTC

[jira] Created: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Remove some synchronization on CachingNamespaceResolver
-------------------------------------------------------

                 Key: JCR-685
                 URL: http://issues.apache.org/jira/browse/JCR-685
             Project: Jackrabbit
          Issue Type: Improvement
    Affects Versions: 1.1.1, 1.1
            Reporter: Marcel Reutegger
            Priority: Minor
             Fix For: 1.2


The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).

I propose the following change:

Index: CachingNamespaceResolver.java
===================================================================
--- CachingNamespaceResolver.java	(revision 488245)
+++ CachingNamespaceResolver.java	(working copy)
@@ -84,7 +84,7 @@
     /**
      * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
      */
-    public synchronized QName getQName(String name)
+    public QName getQName(String name)
             throws IllegalNameException, UnknownPrefixException {
         return NameFormat.parse(name, this);
     }
@@ -92,7 +92,7 @@
     /**
      * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
      */
-    public synchronized String getJCRName(QName name)
+    public String getJCRName(QName name)
             throws NoPrefixDeclaredException {
         return NameFormat.format(name, this);
     }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-685?page=all ]

Marcel Reutegger updated JCR-685:
---------------------------------

    Attachment: CachingNamespaceResolver.patch

How about this one?

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1, 1.1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: CachingNamespaceResolver.patch
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-685?page=comments#action_12460069 ] 
            
Jukka Zitting commented on JCR-685:
-----------------------------------

> How about this one? 

-1 as it feels way too complicated, at least for 1.2.

I also don't believe that replacing synchronization with a r/w lock is going to help performance that much. The readLock.acquire() call also contains a synchronized critical section that might well take longer to execute than the guarded single hash lookup.

I suggest to resolve this issue as currently committed, and to open a separate issue for improving the name resolution performance for Jackrabbit 1.3.

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1, 1.1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: CachingNamespaceResolver.patch
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-685?page=comments#action_12459573 ] 
            
Jukka Zitting commented on JCR-685:
-----------------------------------

+1, and OK for inclusion in 1.2

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1.1, 1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-685?page=comments#action_12459960 ] 
            
Stefan Guggisberg commented on JCR-685:
---------------------------------------

> How about this one?

+1

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1, 1.1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: CachingNamespaceResolver.patch
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Reopened: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-685?page=all ]

Stefan Guggisberg reopened JCR-685:
-----------------------------------

             
there are more synchronized methods that may lead to monitor contention

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1, 1.1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-685?page=all ]

Marcel Reutegger updated JCR-685:
---------------------------------

    Component/s: core

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1.1, 1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-685?page=all ]

Jukka Zitting updated JCR-685:
------------------------------

    Affects Version/s:     (was: 1.1)
                           (was: 1.1.1)

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: CachingNamespaceResolver.patch
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-685?page=comments#action_12460192 ] 
            
Stefan Guggisberg commented on JCR-685:
---------------------------------------

> I suggest to resolve this issue as currently committed, and to open a separate issue for improving the name resolution performance for Jackrabbit 1.3.

i'd rather leave this issue open, the core issue (monitor contention with concurrent read access) still exists a thread dumps show.

the committed fix affected deprecated methods only and doesn't solve the core issue.

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1, 1.1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: CachingNamespaceResolver.patch
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-685?page=all ]

Jukka Zitting resolved JCR-685.
-------------------------------

    Resolution: Fixed

Resolved. Please continue discussion on the core issue in JCR-688.

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1, 1.1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: CachingNamespaceResolver.patch
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-685?page=comments#action_12460195 ] 
            
Jukka Zitting commented on JCR-685:
-----------------------------------

> i'd rather leave this issue open, the core issue (monitor contention with concurrent read access)
> still exists a thread dumps show. 
>
> the committed fix affected deprecated methods only and doesn't solve the core issue.

The issue title and description only mention the deprecated methods. I'd rather open a separate issue with  a better description of the core problem.

Additionally, from the release and Jira management perspective it's troublesome to have issues that are "partially fixed" in a release.

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1, 1.1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>         Attachments: CachingNamespaceResolver.patch
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-685?page=comments#action_12459931 ] 
            
Stefan Guggisberg commented on JCR-685:
---------------------------------------

the following methods are synchronized on the CachingNamespaceResolver 
instance:

QName retrieveName(String jcrName) 
String retrieveName(QName name) 
 
this potentially leads to monitor contention since those methods are 
indirectly called by a lot of jcr api methods (such as Node.getProperty() etc).

a possible solution would be to replace the internal LRUMap's with 
something that's optimized for concurrent read access (e.g.  an LRUMap
implementation that is based on doug lea's ConcurrentReaderHashMap).

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1, 1.1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (JCR-685) Remove some synchronization on CachingNamespaceResolver

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-685?page=all ]

Marcel Reutegger resolved JCR-685.
----------------------------------

    Resolution: Fixed

Fixed in trunk and 1.2 branch.

svn revision: 488671

> Remove some synchronization on CachingNamespaceResolver
> -------------------------------------------------------
>
>                 Key: JCR-685
>                 URL: http://issues.apache.org/jira/browse/JCR-685
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.1, 1.1.1
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.2
>
>
> The methods getQName() and getJCRName() are unnecessarily synchronized and cause monitor contention with concurrent calls to the methods of the NameCache interface (those are also synchronized).
> I propose the following change:
> Index: CachingNamespaceResolver.java
> ===================================================================
> --- CachingNamespaceResolver.java	(revision 488245)
> +++ CachingNamespaceResolver.java	(working copy)
> @@ -84,7 +84,7 @@
>      /**
>       * @deprecated use {@link NameFormat#parse(String, NamespaceResolver)}
>       */
> -    public synchronized QName getQName(String name)
> +    public QName getQName(String name)
>              throws IllegalNameException, UnknownPrefixException {
>          return NameFormat.parse(name, this);
>      }
> @@ -92,7 +92,7 @@
>      /**
>       * @deprecated use {@link NameFormat#format(QName, NamespaceResolver)}
>       */
> -    public synchronized String getJCRName(QName name)
> +    public String getJCRName(QName name)
>              throws NoPrefixDeclaredException {
>          return NameFormat.format(name, this);
>      }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira