jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KÖLL Claus <C.KO...@TIROL.GV.AT>
Subject AW: Repository is started up and shut down in every call
Date Tue, 17 Jun 2014 14:49:06 GMT
Hi,

The RepositoryFactoryImpl creates only a TransientRepository.
You can see it in the Javadoc ...

With ..
RepositoryConfig config = RepositoryConfig.create(xml, dir);
Repository repository = RepositoryImpl.create(config)

you will get a non transient repository.

In a JCA environment the repository creation mechanism is different.
If there are two params [homedir and configfile] it will create the repository with 

RepositoryConfig config = RepositoryConfig.create(xml, dir);
Repository repository = RepositoryImpl.create(config)

and if not it will use the RepositoryFactory.

hope now it's clear

greets
claus


-----Ursprüngliche Nachricht-----
Von: Frizz [mailto:frizzthecat@googlemail.com] 
Gesendet: Dienstag, 17. Juni 2014 16:07
An: users@jackrabbit.apache.org
Betreff: Re: Repository is started up and shut down in every call

Still I don't understand why (1) results in a TransientRepository whereas
(2) does not - since both get a config file and a repository directory
location.

(1)
cfgMap.put(RepositoryFactoryImpl.REPOSITORY_CONF, configLocation);
cfgMap.put(RepositoryFactoryImpl.REPOSITORY_HOME, repositoryLocation);

RepositoryFactory repositoryFactory = new RepositoryFactoryImpl();
repository = repositoryFactory.getRepository(cfgMap);

(2)
RepositoryConfig config = RepositoryConfig.create(xml, dir);
Repository repository = RepositoryImpl.create(config)
Mime
View raw message