jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mueller <muel...@adobe.com>
Subject Re: All in-memory and unit/integration tests
Date Tue, 29 Mar 2011 10:30:00 GMT
Hi,

Could you try with a regular (persisted) database? For example, using the
database URL "jdbc:h2:/temp/test".

I guess you will still get the same result, but let's see.

If the data is still lost between closing and opening a session, then
there must be some code that actively deletes the data.

If it works with a persisted database, then the question is: do you start
a new process, or use a different class loader for each test? If yes then
preserving the data is not possible, except when using a persisted
database (or file system).

Regards,
Thomas





On 3/29/11 12:23 PM, "Bruno Dusausoy" <bdusausoy@yp5.be> wrote:

>On 03/29/2011 11:23 AM, Thomas Mueller wrote:
>> Hi,
>>
>> I'm not sure if the in-memory persistence manager is still supported (it
>> has been deprecated). What does work is using an in-memory Java database
>> such as the H2 database, and use it as the persistence manager and file
>> system. To ensure the data is not deleted between two runs (within the
>> same process), you could use the database URL "jdbc:h2:memFS:test" - see
>> also http://h2database.com/html/advanced.html#file_system
>>
>> Also, you should disable the Lucene index. You will still need a
>> repository.xml file I believe (not sure if this can be avoided).
>>
>> Regards,
>> Thomas
>>
>
>Thanks, Thomas, for your quick answer.
>I've put all I could put in H2 (FileSystem, PersistenceManager), but I
>get the same result as before : my data are lost between when I close a
>session and reopen another one.
>
>Did I do something wrong with my configuration ?
>Here it is :
>
><?xml version="1.0"?>
><!DOCTYPE Repository
>         PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit
>2.0//EN"
>         "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
><Repository>
>     <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
>         <param name="driver" value="org.h2.Driver"/>
>         <param name="url" value="jdbc:h2:memFS:test"/>
>     </FileSystem>
>     <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>
>     <Security appName="Jackrabbit">
>         <SecurityManager
>class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
>                          workspaceName="security">
>         </SecurityManager>
>         <AccessManager
>class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
>         </AccessManager>
>         <LoginModule
>class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
>             <param name="anonymousId" value="anonymous"/>
>             <param name="adminId" value="admin"/>
>         </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="org.h2.Driver"/>
>             <param name="url" value="jdbc:h2:memFS:testWsp"/>
>         </FileSystem>
>         <PersistenceManager
>class="org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager">
>             <param name="driver" value="org.h2.Driver"/>
>             <param name="url" value="jdbc:h2:mem:itemState"/>
>         </PersistenceManager>
>     </Workspace>
>     <Versioning rootPath="${rep.home}/version">
>         <FileSystem
>class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
>             <param name="driver" value="org.h2.Driver"/>
>             <param name="url" value="jdbc:h2:memFS:test/version"/>
>         </FileSystem>
>         <PersistenceManager
>class="org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager">
>             <param name="driver" value="org.h2.Driver"/>
>             <param name="url" value="jdbc:h2:mem:version"/>
>         </PersistenceManager>
>     </Versioning>
></Repository>
>
>Regards.
>--
>Pensez environnement : limitez l'impression de ce mail.
>Please don't print this e-mail unless you really need to.


Mime
View raw message