You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Micah Whitacre (JIRA)" <ji...@apache.org> on 2008/01/16 20:02:39 UTC

[jira] Created: (JCR-1318) Repository Home locked not released despite RepositoryException being thrown.

Repository Home locked not released despite RepositoryException being thrown.
-----------------------------------------------------------------------------

                 Key: JCR-1318
                 URL: https://issues.apache.org/jira/browse/JCR-1318
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 1.3.3
         Environment: windows vista  jdk 5
            Reporter: Micah Whitacre


When an exception is thrown when calling RepositoryImpl.create(...) a .lock file is created in the repository home directory and not removed despite there no longer being an active connection.  If the user attempts to create the repository again (e.g recover from the exception because the url of the repository was temporarily unavailable) a RepositoryException is thrown again indicating that the repository home is locked by another process because there is a .lock file.  If a Repository is not successfully created then the repository home should not be locked.

The lock is only released when the repository is shutdown but in this case the Repository object is never created successfully for that method to be called.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (JCR-1318) Repository Home locked not released despite RepositoryException being thrown.

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg reassigned JCR-1318:
--------------------------------------

    Assignee: Stefan Guggisberg

> Repository Home locked not released despite RepositoryException being thrown.
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1318
>                 URL: https://issues.apache.org/jira/browse/JCR-1318
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.3.3
>         Environment: windows vista  jdk 5
>            Reporter: Micah Whitacre
>            Assignee: Stefan Guggisberg
>         Attachments: JCR_1318-patch.txt, JCR_1318_tests.zip
>
>
> When an exception is thrown when calling RepositoryImpl.create(...) a .lock file is created in the repository home directory and not removed despite there no longer being an active connection.  If the user attempts to create the repository again (e.g recover from the exception because the url of the repository was temporarily unavailable) a RepositoryException is thrown again indicating that the repository home is locked by another process because there is a .lock file.  If a Repository is not successfully created then the repository home should not be locked.
> The lock is only released when the repository is shutdown but in this case the Repository object is never created successfully for that method to be called.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-1318) Repository Home locked not released despite RepositoryException being thrown.

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg resolved JCR-1318.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.4

fixed in svn r613160.

micah, thanks for reporting this issue and providing a test case incl. patch!
WRT your patch: i've chosen a slightly different approach (that you also 
mentioned in your comment).



> Repository Home locked not released despite RepositoryException being thrown.
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1318
>                 URL: https://issues.apache.org/jira/browse/JCR-1318
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.3.3
>         Environment: windows vista  jdk 5
>            Reporter: Micah Whitacre
>            Assignee: Stefan Guggisberg
>             Fix For: 1.3.4
>
>         Attachments: JCR_1318-patch.txt, JCR_1318_tests.zip
>
>
> When an exception is thrown when calling RepositoryImpl.create(...) a .lock file is created in the repository home directory and not removed despite there no longer being an active connection.  If the user attempts to create the repository again (e.g recover from the exception because the url of the repository was temporarily unavailable) a RepositoryException is thrown again indicating that the repository home is locked by another process because there is a .lock file.  If a Repository is not successfully created then the repository home should not be locked.
> The lock is only released when the repository is shutdown but in this case the Repository object is never created successfully for that method to be called.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1318) Repository Home locked not released despite RepositoryException being thrown.

Posted by "Micah Whitacre (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Micah Whitacre updated JCR-1318:
--------------------------------

    Attachment: JCR_1318_tests.zip

Created a testcase which will demonstrate the behavior I'm talking about.  Dropping the testcase and the repository.xml in the root of a java project that is setup with jackrabbit 1.3.3 as a dependency and JUnit 4.4 is all that should be needed.

As mentioned the behavior you should be seeing is that the first attempt to create a RepositoryImpl will fail because there are no suitable drivers to connect to a database whose URL is "jdbc:foo:bar".  The second attempt to connect however doesn't fail for the same reason and instead fails because of the .lock file being present.

> Repository Home locked not released despite RepositoryException being thrown.
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1318
>                 URL: https://issues.apache.org/jira/browse/JCR-1318
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.3.3
>         Environment: windows vista  jdk 5
>            Reporter: Micah Whitacre
>         Attachments: JCR_1318_tests.zip
>
>
> When an exception is thrown when calling RepositoryImpl.create(...) a .lock file is created in the repository home directory and not removed despite there no longer being an active connection.  If the user attempts to create the repository again (e.g recover from the exception because the url of the repository was temporarily unavailable) a RepositoryException is thrown again indicating that the repository home is locked by another process because there is a .lock file.  If a Repository is not successfully created then the repository home should not be locked.
> The lock is only released when the repository is shutdown but in this case the Repository object is never created successfully for that method to be called.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1318) Repository Home locked not released despite RepositoryException being thrown.

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-1318:
-------------------------------

    Affects Version/s: 1.4
        Fix Version/s:     (was: 1.3.4)
                       core 1.4.1

Merged to the 1.4 branch in revision 628324.

> Repository Home locked not released despite RepositoryException being thrown.
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1318
>                 URL: https://issues.apache.org/jira/browse/JCR-1318
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.3.3, 1.4
>         Environment: windows vista  jdk 5
>            Reporter: Micah Whitacre
>            Assignee: Stefan Guggisberg
>             Fix For: core 1.4.1
>
>         Attachments: JCR_1318-patch.txt, JCR_1318_tests.zip
>
>
> When an exception is thrown when calling RepositoryImpl.create(...) a .lock file is created in the repository home directory and not removed despite there no longer being an active connection.  If the user attempts to create the repository again (e.g recover from the exception because the url of the repository was temporarily unavailable) a RepositoryException is thrown again indicating that the repository home is locked by another process because there is a .lock file.  If a Repository is not successfully created then the repository home should not be locked.
> The lock is only released when the repository is shutdown but in this case the Repository object is never created successfully for that method to be called.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1318) Repository Home locked not released despite RepositoryException being thrown.

Posted by "Micah Whitacre (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Micah Whitacre updated JCR-1318:
--------------------------------

    Attachment: JCR_1318-patch.txt

I created a patch based on the 1.3 branch of jackrabbit-core that isn't necessarily pretty but does at least make the testcase i provided repeatedly generate the same stack trace for attempts to create an instance of RepositoryImpl.  This could probably be simplified a bit if the shutdown() method was a little bit more tolerant of everything not necessarily being initialized by that point.  

> Repository Home locked not released despite RepositoryException being thrown.
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1318
>                 URL: https://issues.apache.org/jira/browse/JCR-1318
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.3.3
>         Environment: windows vista  jdk 5
>            Reporter: Micah Whitacre
>         Attachments: JCR_1318-patch.txt, JCR_1318_tests.zip
>
>
> When an exception is thrown when calling RepositoryImpl.create(...) a .lock file is created in the repository home directory and not removed despite there no longer being an active connection.  If the user attempts to create the repository again (e.g recover from the exception because the url of the repository was temporarily unavailable) a RepositoryException is thrown again indicating that the repository home is locked by another process because there is a .lock file.  If a Repository is not successfully created then the repository home should not be locked.
> The lock is only released when the repository is shutdown but in this case the Repository object is never created successfully for that method to be called.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.