If you're just doing unit testing, we've been very happy with an in-memory repository. It still needs some tmp directory setup/teardown but a parent test case deals with that. Here's our repository XML:
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN" "http://jackrabbit.apache.org/dtd/repository-2.0.dtd"> <!-- Minimal memory-based JCR configuration file for unit testing --> <Repository> <FileSystem class="org.apache.jackrabbit.core.fs.mem.MemoryFileSystem"/> <Security appName="Jackrabbit"> <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager"/> <LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule"> <param name="anonymousId" value="anonymous"/> </LoginModule> </Security> <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="draft"/> <Workspace name="${wsp.name}"> <FileSystem class="org.apache.jackrabbit.core.fs.mem.MemoryFileSystem"/> <PersistenceManager class="org.apache.jackrabbit.core.persistence.mem.InMemPersistenceManage r"> <param name="persistent" value="false"/> </PersistenceManager> <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> <param name="path" value="${wsp.home}/index"/> </SearchIndex> </Workspace> <Versioning rootPath="${rep.home}/versions"> <FileSystem class="org.apache.jackrabbit.core.fs.mem.MemoryFileSystem"/> <PersistenceManager class="org.apache.jackrabbit.core.persistence.mem.InMemPersistenceManage r"> <param name="persistent" value="false"/> </PersistenceManager> </Versioning> <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> <param name="path" value="${rep.home}/repository/index"/> </SearchIndex> </Repository> Enjoy - -----Original Message----- From: Rakesh Vidyadharan [mailto:[email protected]] Sent: Thursday, November 11, 2010 8:54 AM To: [email protected] Subject: Re: 30 secondes to create and open a repository ? On 11 Nov 2010, at 07:21, Ista Pouss wrote: > 2010/11/11 Cech. Ulrich <[email protected]> > >> < No, I configure nothing ; the repository goes in an empty directory, as >> you can see with dirs.mkdirs().> >> Then, try to configure a repository.xml and choose simple FileSystem as >> PersistenceManager and so on and give this XML to the TransientRepository to >> check, if this makes some difference. >> >> > With BundleFsPersistenceManager, the same take only 3 secondes ! > > It seem that DerbyPersistenceManager, the default, is very time expensive, > for me, at startup. Try h2. It is quite a bit faster to startup than Derby. It also has the benefit that a crash will usually not require manually deleting lock files. Rakesh
