jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-1778) BindableRepositoryFactory doesn't handle repository shutdown
Date Tue, 30 Sep 2008 13:21:44 GMT
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.


Mime
View raw message