You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Francesco Mari (JIRA)" <ji...@apache.org> on 2015/04/21 11:46:59 UTC
[jira] [Updated] (OAK-2760) HttpServer in Oak creates multiple
instance of ContentRepository
[ https://issues.apache.org/jira/browse/OAK-2760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Francesco Mari updated OAK-2760:
--------------------------------
Attachment: OAK-2760-01.patch
[~chetanm], [~mduerig]: this patch caches a {{ContentRepository}} instance in the {{Oak}} builder and a {{Repository}} instance in the {{Jcr}} builder. This should be sufficient to guarantee that repository instances are created and initialized only once. Moreover, the {{ContentRepository}} instance is also accessible through the {{Jcr}} builder.
> HttpServer in Oak creates multiple instance of ContentRepository
> ----------------------------------------------------------------
>
> Key: OAK-2760
> URL: https://issues.apache.org/jira/browse/OAK-2760
> Project: Jackrabbit Oak
> Issue Type: Sub-task
> Components: run
> Reporter: Chetan Mehrotra
> Priority: Minor
> Fix For: 1.3.0
>
> Attachments: OAK-2760-01.patch
>
>
> Http Server in oak-run constructs multiple repository instance of ContentRepository [1]
> {code}
> Jcr jcr = new Jcr(oak);
> // 1 - OakServer
> ContentRepository repository = oak.createContentRepository();
> ServletHolder holder = new ServletHolder(new OakServlet(repository));
> context.addServlet(holder, path + "/*");
> // 2 - Webdav Server on JCR repository
> final Repository jcrRepository = jcr.createRepository();
> {code}
> In above code a repository instance is created twice via same Oak instance 1 in OakServer and 2 for webdav.
> [1] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java#L1125-1133
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)