You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Brian Thompson <el...@gmail.com> on 2007/02/14 17:42:01 UTC
Repository Persistence
Hello all,
In my application, I have Jackrabbit configured via Spring:
<bean id="repository" class="
org.springmodules.jcr.jackrabbit.RepositoryFactoryBean">
<!-- normal factory beans params -->
<property name="configuration" value="classpath:jackrabbit-repo.xml
"/>
<property name="homeDir" value="${jcr.homedir}"/>
</bean>
I'm using DbFileSystem and SimpleDbPersistenceManager to persist repository
objects to a SQL Server DB. However, if I delete the Jackrabbit directories
in my application, I lose the contents of the repository.
Do I have a mistake in my configuration, or does Jackrabbit use local
filesystem resources regardless of its database use?
Here's my repository.xml:
<Repository>
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="driver" value="
com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<param name="url"
value="jdbc:sqlserver://dbserver:1433;databaseName=jackrabbit"/>
<param name="schema" value="mssql"/>
<param name="user" value="test"/>
<param name="password" value="test"/>
<param name="schemaObjectPrefix" value="rep_"/>
</FileSystem>
<Security appName="Jackrabbit">
<AccessManager class="
org.apache.jackrabbit.core.security.SimpleAccessManager">
</AccessManager>
<LoginModule class="
org.apache.jackrabbit.core.security.SimpleLoginModule">
<param name="anonymousId" value="anonymous"/>
</LoginModule>
</Security>
<Workspaces rootPath="${rep.home}/workspaces"
defaultWorkspace="default"/>
<Workspace name="${wsp.name}">
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="driver" value="
com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<param name="url"
value="jdbc:sqlserver://dbserver:1433;databaseName=jackrabbit"/>
<param name="schema" value="mssql"/>
<param name="user" value="test"/>
<param name="password" value="test"/>
<param name="schemaObjectPrefix" value="wsk_"/>
</FileSystem>
<PersistenceManager class="
org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
<param name="driver" value="
com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<param name="url"
value="jdbc:sqlserver://dbserver:1433;databaseName=jackrabbit"/>
<param name="schema" value="mssql"/>
<param name="user" value="test"/>
<param name="password" value="test"/>
<param name="schemaObjectPrefix" value="${wsp.name}_"/>
<param name="externalBLOBs" 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}/version">
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="driver" value="
com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<param name="url"
value="jdbc:sqlserver://dbserver:1433;databaseName=jackrabbit"/>
<param name="schema" value="mssql"/>
<param name="user" value="test"/>
<param name="password" value="test"/>
<param name="schemaObjectPrefix" value="ver_"/>
</FileSystem>
<PersistenceManager class="
org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
<param name="driver" value="
com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<param name="url"
value="jdbc:sqlserver://dbserver:1433;databaseName=jackrabbit"/>
<param name="schema" value="mssql"/>
<param name="user" value="test"/>
<param name="password" value="test"/>
<param name="externalBLOBs" value="false"/>
<param name="schemaObjectPrefix" value="version_"/>
</PersistenceManager>
</Versioning>
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex
">
<param name="path" value="${rep.home}/repo/index"/>
</SearchIndex>
</Repository>
-Brian
Re: Repository Persistence
Posted by Stefan Guggisberg <st...@gmail.com>.
hi brian,
On 2/14/07, Brian Thompson <el...@gmail.com> wrote:
> Hello all,
>
> In my application, I have Jackrabbit configured via Spring:
>
> <bean id="repository" class="
> org.springmodules.jcr.jackrabbit.RepositoryFactoryBean">
> <!-- normal factory beans params -->
> <property name="configuration" value="classpath:jackrabbit-repo.xml
> "/>
> <property name="homeDir" value="${jcr.homedir}"/>
> </bean>
>
> I'm using DbFileSystem and SimpleDbPersistenceManager to persist repository
> objects to a SQL Server DB. However, if I delete the Jackrabbit directories
> in my application, I lose the contents of the repository.
>
> Do I have a mistake in my configuration, or does Jackrabbit use local
> filesystem resources regardless of its database use?
lucene index files are always stored in the local file system. furthermore,
the workspace.xml files are by default stored/read from the local file system.
if you wish to store the workspace configurations in the virtual file system
you can do so by additionally specifying the 'configRoot' attribute in
the <Workspaces/> config element (repository.xml), e.g.
<!--
the Workspaces element specifies the physical workspaces root directory
(rootPath attribute), the name of the default workspace
(defaultWorkspace attribute) and optionally the workspace configuration
root directory within the virtual repository file system (configRootPath
attribute).
individual workspaces are configured through individual workspace.xml
files located in a subfolder each of either
a) the physical workspaces root directory
or, if configRootPath had been specified,
b) the configuration root directory within the virtual
repository file system.
-->
<Workspaces rootPath="${rep.home}/wspHomes"
defaultWorkspace="default" configRootPath="/wspConfigs"/>
however, unless you've got a compelling reason ii wouldn't recommend using this
option since it makes it a lot more difficult to track down
configuration issues.
cheers
stefan
>
>
>
> Here's my repository.xml:
>
> <Repository>
> <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
> <param name="driver" value="
> com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
> <param name="url"
> value="jdbc:sqlserver://dbserver:1433;databaseName=jackrabbit"/>
> <param name="schema" value="mssql"/>
> <param name="user" value="test"/>
> <param name="password" value="test"/>
> <param name="schemaObjectPrefix" value="rep_"/>
> </FileSystem>
>
> <Security appName="Jackrabbit">
> <AccessManager class="
> org.apache.jackrabbit.core.security.SimpleAccessManager">
> </AccessManager>
>
> <LoginModule class="
> org.apache.jackrabbit.core.security.SimpleLoginModule">
> <param name="anonymousId" value="anonymous"/>
> </LoginModule>
> </Security>
>
> <Workspaces rootPath="${rep.home}/workspaces"
> defaultWorkspace="default"/>
> <Workspace name="${wsp.name}">
> <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
> <param name="driver" value="
> com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
> <param name="url"
> value="jdbc:sqlserver://dbserver:1433;databaseName=jackrabbit"/>
> <param name="schema" value="mssql"/>
> <param name="user" value="test"/>
> <param name="password" value="test"/>
> <param name="schemaObjectPrefix" value="wsk_"/>
> </FileSystem>
> <PersistenceManager class="
> org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
> <param name="driver" value="
> com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
> <param name="url"
> value="jdbc:sqlserver://dbserver:1433;databaseName=jackrabbit"/>
> <param name="schema" value="mssql"/>
> <param name="user" value="test"/>
> <param name="password" value="test"/>
> <param name="schemaObjectPrefix" value="${wsp.name}_"/>
> <param name="externalBLOBs" 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}/version">
> <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
> <param name="driver" value="
> com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
> <param name="url"
> value="jdbc:sqlserver://dbserver:1433;databaseName=jackrabbit"/>
> <param name="schema" value="mssql"/>
> <param name="user" value="test"/>
> <param name="password" value="test"/>
> <param name="schemaObjectPrefix" value="ver_"/>
> </FileSystem>
>
> <PersistenceManager class="
> org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
> <param name="driver" value="
> com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
> <param name="url"
> value="jdbc:sqlserver://dbserver:1433;databaseName=jackrabbit"/>
> <param name="schema" value="mssql"/>
> <param name="user" value="test"/>
> <param name="password" value="test"/>
> <param name="externalBLOBs" value="false"/>
> <param name="schemaObjectPrefix" value="version_"/>
> </PersistenceManager>
> </Versioning>
>
> <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex
> ">
> <param name="path" value="${rep.home}/repo/index"/>
> </SearchIndex>
> </Repository>
>
> -Brian
>