[
https://issues.apache.org/jira/browse/JCR-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13224222#comment-13224222
]
angela commented on JCR-3249:
-----------------------------
i don't think this is intentional.... but it would definitely be a good thing
to clarify this in the javadoc and adjust the implementations accordingly.
thanks for spotting this!
> clarify/tune RepositoryService lifecycle
> ----------------------------------------
>
> Key: JCR-3249
> URL: https://issues.apache.org/jira/browse/JCR-3249
> Project: Jackrabbit Content Repository
> Issue Type: Improvement
> Components: jackrabbit-jcr2spi, jackrabbit-spi
> Reporter: Julian Reschke
>
> Spent some time with a caching issue in my RepositoryService, only to find
> out that the lifecycle of the service is not necessarily the same as the one
> of the JCR2SPI RepositoryImpl.
> See
> public Session login(Credentials credentials, String workspaceName)
> throws LoginException, NoSuchWorkspaceException, RepositoryException {
> SessionInfo info = config.getRepositoryService().obtain(credentials,
> workspaceName);
> try {
> if (info instanceof XASessionInfo) {
> return new XASessionImpl((XASessionInfo) info, this, config);
> } else {
> return new SessionImpl(info, this, config);
> }
> } catch (RepositoryException ex) {
> config.getRepositoryService().dispose(info);
> throw ex;
> }
> }
> So unless the RepositoryConfig caches the service, a new one will be built
> for each new JCR session.
> Is this intentional? In which case we should augment the Javadoc. Otherwise
> it might be good to change it to have a one-to-ine relation between
> Repository and RepositoryService...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira