jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JCR-3006) UserManager: concurrent user creation using same intermediate path fails
Date Mon, 27 Jun 2011 16:28:47 GMT
UserManager: concurrent user creation using same intermediate path fails

                 Key: JCR-3006
                 URL: https://issues.apache.org/jira/browse/JCR-3006
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: security
    Affects Versions: 2.2.7
            Reporter: Stefan Guggisberg
         Attachments: ConcurrentCreateUserTest.java

concurrently creating users using same intermediate path fails with "node ... has been modified

the problem is the intermediate path. if it doesn't exist multiple threads try to create it

o.a.jackrabbit.core.security.user.UserManagerImpl, line 1310ff:

            String[] segmts = defaultPath.split("/");
            NodeImpl folder = (NodeImpl) session.getRootNode();
            String authRoot = (isGroup) ? groupsPath : usersPath;

            for (String segment : segmts) {
                if (segment.length() < 1) {
                if (folder.hasNode(segment)) {
                    folder = (NodeImpl) folder.getNode(segment);
                    if (Text.isDescendantOrEqual(authRoot, folder.getPath()) &&
                            !folder.isNodeType(NT_REP_AUTHORIZABLE_FOLDER)) {
                        throw new ConstraintViolationException("Invalid intermediate path.
Must be of type rep:AuthorizableFolder.");
                } else {
                    Node parent = folder;
                    folder = addNode(folder, session.getQName(segment), NT_REP_AUTHORIZABLE_FOLDER);

the attached test case illustrates this issue/

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message