jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: Synchronize block in BindableRepositoryFactory
Date Tue, 12 Nov 2013 19:52:27 GMT
Hi Kiran,

On Tue, Nov 12, 2013 at 2:05 PM, ksingh <ksingh@responsys.com> wrote:
> 1. It makes sense to have this block if all the requests are for the same
> repository instance (one reference key) so that all the requests for one
> repository are serialized and they all do not try to start it if not already
> there. But blocking requests if they are for different repositories doesn't
> make sense. Is there a good reason why we have this?

The synchronization is required to prevent concurrent modification of
the cache map.

> 2. It would not be an issue if starting of a repository is very quick, but
> since getting a repository instance also  builds the index if missing, it
> can take very long. So is there a way to decouple these two activities so
> that starting a repository, only gets the instance and is very quick and one
> can invoke the separate method to build the index for a repository, if there
> is such need?

It seems like the best way to achieve that would be to call the
BindableRepository.init() method lazily when the repository is first
accessed instead of directly in the constructor.

You may want to file an improvement request [1] for that? Even better
if you can contribute a patch for changing the relevant code.

[1] https://issues.apache.org/jira/browse/JCR


Jukka Zitting

View raw message