jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg" <stefan.guggisb...@gmail.com>
Subject Re: mysql for filesystem
Date Fri, 26 May 2006 13:47:16 GMT
hi nicolas,

On 5/25/06, Nicolas Modrzyk <Nicolas.Modrzyk@macnica.com> wrote:
> 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.

i found the problem. your mysql db is utf8 as default charset.

> com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Specified key
> was too long; max key length is 1000 byte

this error is thrown by the following line in mysql.dll:

create unique index ${schemaObjectPrefix}FSENTRY_IDX on
${schemaObjectPrefix}FSENTRY (FSENTRY_PATH(245), FSENTRY_NAME)

the above statement works fine with latin1 databases. keys would be
500 bytes, so well beyond the limit. but in utf8 a character can take
up as much as 3 bytes, 3 * 500 > 1000; hence the exception

you can do any of the following to work around this issue:

1) use a latin1 db
2) modify the mysql.dll to create a latin1 table, i.e.
   create table .... charset latin1
3) modify the mysql.dll to limit the key to 333 characters, e.g.

create unique index ... (FSENTRY_PATH(233), FSENTRY_NAME(100))

i'd recommend option 1) or 2).

some related information:
http://www.xaprb.com/blog/2006/04/17/max-key-length-in-mysql/
http://dev.mysql.com/doc/refman/5.0/en/create-index.html

>
> Does that mean it is better to simply have the persistence manager
> using the database, but keeping the FileSystem as regular files ?

in general, yes.

cheers
stefan

>
> 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