Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
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)
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...