jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giota Karadimitriou" <Giota.Karadimitr...@eurodyn.com>
Subject RE: mysql for filesystem
Date Thu, 25 May 2006 10:53:49 GMT
Hello,

If you use SimpleDBPersistence manager (or similar), LocalFileSystem and
externalBlobs=false the only things to be actually kept in your local
filesystem will be repository.xml, workspace.xml, custom_nodetypes.xml
and 
ns_reg.properties (under proper dirs of course) and search indexes.

If however for some reason you must use DBFileSystem, I ran into a
similar problem to yours (among others) when trying to integrate Oracle
database using DBFileSystem. I don't know if it is your intention to
change jackrabbit code or you use it as black box so to speak...anyway
if you want to modify it here is my experience on the matter:

First of all if the exception concerns some table column (edit
DBFileSystem and put some logs to find out) you could modify the
mysql.ddl found under org\apache\jackrabbit\core\state\db and
org\apache\jackrabbit\core\fs\db and increase the varchar or char size.

In my case it was the table name which was too big. I solved this quite
dirty by modifying the source code of DBFileSystem class and truncating
the schema name. Like I said this is dirty but it worked for me so this
is what I did:


protected void prepareSchemaObjectPrefix() throws Exception {
...
//Commented escaping and replaced it with "_" every time a character
that //needs escape is encountered

if (legalChars.indexOf(c) == -1) {
             /*escaped.append("_x");
                String hex = Integer.toHexString(c);
                escaped.append("0000".toCharArray(), 0, 4 -
hex.length());
                escaped.append(hex);*/
                escaped.append("_");
            } else {
                escaped.append(c);
            }
...

schemaObjectPrefix = escaped.toString();

//ADDED THE FOLLOWING CODE
        if (schemaObjectPrefix.length()>20) {
          log.debug("schema BIG****:" + schemaObjectPrefix);
          schemaObjectPrefix = schemaObjectPrefix.substring(
              schemaObjectPrefix.length() - 20,
schemaObjectPrefix.length());
          int index = schemaObjectPrefix.indexOf("_");
          schemaObjectPrefix =
              schemaObjectPrefix.substring(index + 1,
schemaObjectPrefix.length());
          log.debug("schema SMALL****:" + schemaObjectPrefix);
        }

}

 
hope this helps
Giota

> -----Original Message-----
> From: Nicolas Modrzyk [mailto:Nicolas.Modrzyk@macnica.com]
> Sent: Thursday, May 25, 2006 11:30 AM
> To: dev@jackrabbit.apache.org
> Subject: Re: mysql for filesystem
> 
> HI Stefan,
> 
> Thank you for your quick answer. See below for my full configuration.
> I don't have the full strack trace anymore, I will try to reproduce
it.
> 
> Does that mean it is better to simply have the persistence manager
> using the database, but keeping the FileSystem as regular files ?
> 
> Regards,
> 
> Nicolas,
> 
> ============= Jackrabbit configuration file =================
> <Repository>
>          <FileSystem
> class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
>              <param name="driver" value="com.mysql.jdbc.Driver"/>
>              <param name="url" value="jdbc:mysql:///test"/>
>              <param name="schema" value="mysql"/>
>              <param name="user" value="xxx"/>
>              <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="default">
>          <FileSystem
> class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>              <param name="path" value="${wsp.home}/default" />
>          </FileSystem>
>          <PersistenceManager
>
class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
>              <param name="driver" value="com.mysql.jdbc.Driver"/>
>              <param name="url" value="jdbc:mysql:///test"/>
>              <param name="schema" value="mysql"/>
>              <param name="user" value="xxx"/>
>              <param name="schemaObjectPrefix" value="${wsp.name}_"/>
>              <param name="externalBLOBs" value="false"/>
>          </PersistenceManager>
>          <SearchIndex
> class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>              <param name="textFilterClasses"
> 
>
value="org.apache.jackrabbit.core.query.MsExcelTextFilter,org.apache.jac
>
krabbit.core.query.MsPowerPointTextFilter,org.apache.jackrabbit.core.que
>
ry.MsWordTextFilter,org.apache.jackrabbit.core.query.PdfTextFilter,org.a
>
pache.jackrabbit.core.query.HTMLTextFilter,org.apache.jackrabbit.core.qu
> ery.XMLTextFilter,org.apache.jackrabbit.core.query.RTFTextFilter"/>
>              <param name="path" value="${wsp.home}/index"/>
>              <param name="useCompoundFile" value="true"/>
>              <param name="minMergeDocs" value="100"/>
>              <param name="volatileIdleTime" value="3"/>
>              <param name="maxMergeDocs" value="100000"/>
>              <param name="mergeFactor" value="10"/>
>              <param name="bufferSize" value="10"/>
>          </SearchIndex>
>      </Workspace>
>      <Versioning rootPath="${rep.home}/version">
>          <FileSystem
> class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>              <param name="path"
value="${rep.home}/workspaces/version"/>
>          </FileSystem>
>          <PersistenceManager
>
class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
>              <param name="driver" value="com.mysql.jdbc.Driver"/>
>              <param name="url" value="jdbc:mysql:///test"/>
>              <param name="schema" value="mysql"/>
>              <param name="user" value="xxx"/>
>              <param name="schemaObjectPrefix" value="version_"/>
>              <param name="externalBLOBs" value="false"/>
>          </PersistenceManager>
>      </Versioning>
> </Repository>


Mime
View raw message