You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Grégory Joseph (JIRA)" <ji...@apache.org> on 2009/01/05 19:07:44 UTC
[jira] Commented: (JCR-1778) BindableRepositoryFactory doesn't
handle repository shutdown
[ https://issues.apache.org/jira/browse/JCR-1778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660836#action_12660836 ]
Grégory Joseph commented on JCR-1778:
-------------------------------------
Same goes if you replace {{repository.shutdown()}} by a call to {{RegistryHelper.unregisterRepository}} which is even more worrying. The issue seems to be due to the static cache of BindableRepositoryFactory.
I can reproduce this with 1.4.6 and 1.5.0, not with 1.4.5
> BindableRepositoryFactory doesn't handle repository shutdown
> ------------------------------------------------------------
>
> Key: JCR-1778
> URL: https://issues.apache.org/jira/browse/JCR-1778
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Jukka Zitting
> Priority: Minor
>
> The BindableRepositoryFactory class keeps a cached reference to a repository even after the repository has been shut down.
> This causes the following code snippet to fail with an IllegalStateException:
> Hashtable environment = new Hashtable();
> environment.put(
> Context.INITIAL_CONTEXT_FACTORY,
> DummyInitialContextFactory.class.getName());
> environment.put(Context.PROVIDER_URL, "http://jackrabbit.apache.org/");
> Context context = new InitialContext(environment);
> JackrabbitRepository repository;
> String xml = "src/test/repository/repository.xml";
> String dir = "target/repository";
> String key = "repository";
> // Create first repository
> RegistryHelper.registerRepository(context, key, xml, dir, true);
> repository = (JackrabbitRepository) context.lookup(key);
> repository.login().logout();
> repository.shutdown();
> // Create second repository with the same configuration
> RegistryHelper.registerRepository(context, key, xml, dir, true);
> repository = (JackrabbitRepository) context.lookup(key);
> repository.login().logout(); // throws an IllegalStateException!
> repository.shutdown();
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.