You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Stefan Guggisberg (JIRA)" <ji...@apache.org> on 2006/02/16 04:38:02 UTC

[jira] Resolved: (JCR-318) RepositoryHelper.unregisterRepository() does not allow the repository to be automatically restarted.

     [ http://issues.apache.org/jira/browse/JCR-318?page=all ]
     
Stefan Guggisberg resolved JCR-318:
-----------------------------------

    Resolution: Invalid

when a Repository instance has been shutdown it has been disposed 
and can't be reused anymore.

if you want to 'restart' a repository you can just create a new Repository 
instance, e.g. by calling RegistryHelper.registerRepository() again.


> RepositoryHelper.unregisterRepository() does not allow the repository to be automatically restarted.
> ----------------------------------------------------------------------------------------------------
>
>          Key: JCR-318
>          URL: http://issues.apache.org/jira/browse/JCR-318
>      Project: Jackrabbit
>         Type: Bug
>   Components: core
>     Versions: 0.9
>  Environment: Tomcat 5.5.x, JNDI
>     Reporter: Mark Slater
>     Assignee: Stefan Guggisberg
>     Priority: Minor
>      Fix For: 1.0

>
> Using JNDI to create a model 1 (embedded) repository as suggested in the documentation (http://incubator.apache.org/jackrabbit/doc/deploy/howto-model1.html) returns a BindableRepository instance to the web app. The same documentation page strongly recommends the webapp calls RepositoryImpl.shutdown() in the servlet's destroy() method. However, since BindableRepository is restricted to its package, there is no way for the webapp to access the RepositoryImpl. The RepositoryHelper class provides a unregisterRepository() method which can perform the shutdown. Unfortunately, the method does not allow the repository to be restarted later on, forcing a full restart of Tomcat. The exception thrown when trying to access a repository shut down in this manner in a re-deployed webapp is:
> java.lang.IllegalStateException: repository instance has been shut down
> 	org.apache.jackrabbit.core.RepositoryImpl.sanityCheck(RepositoryImpl.java:481)
> 	org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1005)
> 	org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1080)
> 	org.apache.jackrabbit.core.jndi.BindableRepository.login(BindableRepository.java:174)
> 	org.apache.jackrabbit.deployment_test.JackrabbitTest.testRepository(JackrabbitTest.java:212)
> 	org.apache.jackrabbit.deployment_test.JackrabbitTest.doGet(JackrabbitTest.java:80)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> It may be useful to merge the transient capabilities of TransientRepository into BindableRepository, perhaps making it a factory configuration option. I imagine there's a performance hit to opening a repository, in a shared deployment environment, where the lifecycle is controlled by the application server, it would probably be best to not have the repository be transient.

-- 
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