[ 
https://issues.apache.org/jira/browse/JCR-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14266340#comment-14266340
 ] 

Richard Mundell edited comment on JCR-1320 at 1/6/15 4:25 PM:
--------------------------------------------------------------

Attached (Jackrabbit2.6.5_SybaseASE.zip)  is an implementation for Jackrabbit 
(2.4.5) for SAP (Sybase) Adaptive Server Enterprise.

Sorry it's for an older version but that's the one we're using in Pentaho 
Business Analytics which is the system I need to support ASE.

I've implemented a SybaseASEFileSystem which adjusts the queries to workaround 
the limitations that ASE places on manipulating fields of type IMAGE.

Unfortunately I've also had to modify LockManagerImpl to check for the null 
(\0) character in addition to Java null and Java empty string. This is because 
ASE was returning an IMAGE with a single null (\0) character. If I modified the 
SQL to return a database null it caused the InputStream to be null too which 
caused failures deeper within the call hiearchy when the FileSystemResource 
(for the locksFile) was closed. I couldn't set the return value from ASE to 
empty string as ASE has no concept of this (either it's null, or a single white 
space, and the latter also caused the LockManagerImpl to fail).

I've tested this within a Pentaho Business Analytics Server (5.2) 
implementation, but not standalone, and not using any other tests.

It's working for my purpose. Hopefully someone from this project can take what 
I've done and make some use of it (ideally, getting ASE support into the core 
code base).

Here's a fragment of my repository.xml. Make sure you specify 
"databaseType=Sybase" for DbDataStore and the persistence manager...

  <FileSystem class="org.apache.jackrabbit.core.fs.db.SybaseASEFileSystem">
    <param name="driver" value="net.sourceforge.jtds.jdbc.Driver"/>
    <param name="url" value="jdbc:jtds:sybase://myASEserver:5000/jackrabbit"/>
    <param name="user" value="jcr_user"/>
    <param name="password" value="password"/>
    <param name="schema" value="sybase"/>
    <param name="schemaObjectPrefix" value="prefix"/>
  </FileSystem>

  <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
    <param name="url" value="jdbc:jtds:sybase://myASEserver:5000/jackrabbit"/>
    <param name="driver" value="net.sourceforge.jtds.jdbc.Driver"/>
    <param name="user" value="jcr_user"/>
    <param name="password" value="password"/>
    <param name="databaseType" value="sybase"/>
    <param name="minRecordLength" value="1024"/>
    <param name="maxConnections" value="3"/>
    <param name="copyWhenReading" value="true"/>
    <param name="tablePrefix" value=""/>
    <param name="schemaObjectPrefix" value="prefix"/>
    <param name="databaseType" value="sybase" />
  </DataStore>

  <PersistenceManager 
class="org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager">
    <param name="url" value="jdbc:jtds:sybase://myASEserver:5000/jackrabbit"/>
    <param name="driver" value="net.sourceforge.jtds.jdbc.Driver"/>
    <param name="user" value="jcr_user"/>
    <param name="password" value="password"/>
    <param name="schema" value="sybase"/>
    <param name="databaseType" value="sybase"/>
    <param name="schemaObjectPrefix" value="prefix"/>
  </PersistenceManager>



was (Author: rmundell):
Attached is an implementation for Jackrabbit (2.4.5) for SAP (Sybase) Adaptive 
Server Enterprise.

Sorry it's for an older version but that's the one we're using in Pentaho 
Business Analytics which is the system I need to support ASE.

I've implemented a SybaseASEFileSystem which adjusts the queries to workaround 
the limitations that ASE places on manipulating fields of type IMAGE.

Unfortunately I've also had to modify LockManagerImpl to check for the null 
(\0) character in addition to Java null and Java empty string. This is because 
ASE was returning an IMAGE with a single null (\0) character. If I modified the 
SQL to return a database null it caused the InputStream to be null too which 
caused failures deeper within the call hiearchy when the FileSystemResource 
(for the locksFile) was closed. I couldn't set the return value from ASE to 
empty string as ASE has no concept of this (either it's null, or a single white 
space, and the latter also caused the LockManagerImpl to fail).

I've tested this within a Pentaho Business Analytics Server (5.2) 
implementation, but not standalone, and not using any other tests.

It's working for my purpose. Hopefully someone from this project can take what 
I've done and make some use of it (ideally, getting ASE support into the core 
code base).

Here's a fragment of my repository.xml. Make sure you specify 
"databaseType=Sybase" for DbDataStore and the persistence manager...

  <FileSystem class="org.apache.jackrabbit.core.fs.db.SybaseASEFileSystem">
    <param name="driver" value="net.sourceforge.jtds.jdbc.Driver"/>
    <param name="url" value="jdbc:jtds:sybase://myASEserver:5000/jackrabbit"/>
    <param name="user" value="jcr_user"/>
    <param name="password" value="password"/>
    <param name="schema" value="sybase"/>
    <param name="schemaObjectPrefix" value="prefix"/>
  </FileSystem>

  <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
    <param name="url" value="jdbc:jtds:sybase://myASEserver:5000/jackrabbit"/>
    <param name="driver" value="net.sourceforge.jtds.jdbc.Driver"/>
    <param name="user" value="jcr_user"/>
    <param name="password" value="password"/>
    <param name="databaseType" value="sybase"/>
    <param name="minRecordLength" value="1024"/>
    <param name="maxConnections" value="3"/>
    <param name="copyWhenReading" value="true"/>
    <param name="tablePrefix" value=""/>
    <param name="schemaObjectPrefix" value="prefix"/>
    <param name="databaseType" value="sybase" />
  </DataStore>

  <PersistenceManager 
class="org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager">
    <param name="url" value="jdbc:jtds:sybase://myASEserver:5000/jackrabbit"/>
    <param name="driver" value="net.sourceforge.jtds.jdbc.Driver"/>
    <param name="user" value="jcr_user"/>
    <param name="password" value="password"/>
    <param name="schema" value="sybase"/>
    <param name="databaseType" value="sybase"/>
    <param name="schemaObjectPrefix" value="prefix"/>
  </PersistenceManager>


> Support for Sybase
> ------------------
>
>                 Key: JCR-1320
>                 URL: https://issues.apache.org/jira/browse/JCR-1320
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-core
>    Affects Versions: 2.6.5
>            Reporter: Guido Jäkel
>         Attachments: Jackrabbit2.6.5_SybaseASE.zip, 
> jackrabbit-core-1.4-sybase.jar
>
>
> To use Sybase as a database backend for all the components and different 
> implementation, one need specific sybase.ddl-files to configure a schema 
> sybase. Sybase don't seems to be compatible to one of the already existing 
> schema.
> The following files are required:
> * org/apache/jackrabbit/core/persistence/db/sybase.ddl
> * org/apache/jackrabbit/core/persistence/bundle/sybase.ddl
> * org/apache/jackrabbit/core/fs/db/sybase.ddl
> * org/apache/jackrabbit/core/journal/sybase.ddl
> Thank you for support.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to