Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: jackrabbit-core
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Jukka Zitting added a comment -

        Seems like there still are issues with the patch as attached. Can someone contribute a fixed version?

        Show
        Jukka Zitting added a comment - Seems like there still are issues with the patch as attached. Can someone contribute a fixed version?
        Hide
        Guido Jäkel added a comment -

        The "core reason" seems to be, that Sybase don't allow to test a IMAGE-column to be NULL.

        \java\org\apache\jackrabbit\core\fs\db\DatabaseFileSystem.java:1215

        selectFolderExistSQL = "select 1 from "
        + schemaObjectPrefix + "FSENTRY where FSENTRY_PATH = ? "
        + "and FSENTRY_NAME = ? and FSENTRY_DATA is null";

        By help of SQuirreL, i've verified it: On Sybase

        select * from REP_FSENTRY where FSENTRY_DATA is null

        leads to

        Error: TEXT and IMAGE datatypes may not be used in a WHERE clause, except with the LIKE expression.
        SQLState: S1000
        ErrorCode: 306

        On mySQL (, where this collum data type is longblob), it works flawless.

        Any sybase guru out here?

        Show
        Guido Jäkel added a comment - The "core reason" seems to be, that Sybase don't allow to test a IMAGE-column to be NULL. \java\org\apache\jackrabbit\core\fs\db\DatabaseFileSystem.java:1215 selectFolderExistSQL = "select 1 from " + schemaObjectPrefix + "FSENTRY where FSENTRY_PATH = ? " + "and FSENTRY_NAME = ? and FSENTRY_DATA is null"; By help of SQuirreL, i've verified it: On Sybase select * from REP_FSENTRY where FSENTRY_DATA is null leads to Error: TEXT and IMAGE datatypes may not be used in a WHERE clause, except with the LIKE expression. SQLState: S1000 ErrorCode: 306 On mySQL (, where this collum data type is longblob), it works flawless. Any sybase guru out here?
        Hide
        Guido Jäkel added a comment -

        Dear Stefan,

        i've attached my 2 cents of a patchset, deriving sybase.ddl files from the mssql.ddl. This was done by replacing BIGINT to DECIMAL(19,0) – a great job for sed

        One of the tables have been created on startup, now. But i got:

        com.sybase.jdbc3.jdbc.SybSQLException: TEXT and IMAGE datatypes may not be used in a WHERE clause, except with the LIKE expression.

        at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
        at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
        ...

        Because there no select statements inside the dll resources, the next step may be to locate and change the prepared statements.

        But to what? Or have one to exchange the datatype IMAGE? Or is sybase unusable?

        Show
        Guido Jäkel added a comment - Dear Stefan, i've attached my 2 cents of a patchset, deriving sybase.ddl files from the mssql.ddl. This was done by replacing BIGINT to DECIMAL(19,0) – a great job for sed One of the tables have been created on startup, now. But i got: com.sybase.jdbc3.jdbc.SybSQLException: TEXT and IMAGE datatypes may not be used in a WHERE clause, except with the LIKE expression. at com.sybase.jdbc3.tds.Tds.a(Unknown Source) at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source) ... Because there no select statements inside the dll resources, the next step may be to locate and change the prepared statements. But to what? Or have one to exchange the datatype IMAGE? Or is sybase unusable?
        Hide
        Stefan Guggisberg added a comment -

        as i've mentioned earlier, i don't have a sybase db server available for testing.

        if you can provide a patch for the sybase ddl files and you can confirm that they're working,
        i'd be happy tho commit the new files.

        Show
        Stefan Guggisberg added a comment - as i've mentioned earlier, i don't have a sybase db server available for testing. if you can provide a patch for the sybase ddl files and you can confirm that they're working, i'd be happy tho commit the new files.
        Hide
        Guido Jäkel added a comment -

        Dear Stefan,

        realy thank you for your helpful analysis. You have been right, because i made a mistake: On the last of all of the experimental changings of schema I changed the main repository configuration with it's template for the workspace, but not the derived workspace.xml. Gotcha, 1:0 for you!

        But after double-checking the configuration ...

        20080118-150934.837 ERROR [main] [] [DbFileSystem] failed to initialize file system
        com.sybase.jdbc3.jdbc.SybSQLException: Can't find type 'bigint'.

        at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
        at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)

        Now, it's 1:1, again

        From your db.apache.org-links above, i would say, that sybase still don't know BIGINT but the MS counterpart since V2000 (whow!). And one have to use DECIMAL(19,0).

        Show
        Guido Jäkel added a comment - Dear Stefan, realy thank you for your helpful analysis. You have been right, because i made a mistake: On the last of all of the experimental changings of schema I changed the main repository configuration with it's template for the workspace, but not the derived workspace.xml. Gotcha, 1:0 for you! But after double-checking the configuration ... 20080118-150934.837 ERROR [main] [] [DbFileSystem] failed to initialize file system com.sybase.jdbc3.jdbc.SybSQLException: Can't find type 'bigint'. at com.sybase.jdbc3.tds.Tds.a(Unknown Source) at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source) Now, it's 1:1, again From your db.apache.org-links above, i would say, that sybase still don't know BIGINT but the MS counterpart since V2000 (whow!). And one have to use DECIMAL(19,0).
        Hide
        Stefan Guggisberg added a comment -

        > 20080117-121337.671 ERROR [main] [] [DbFileSystem] failed to initialize file system
        > com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near 'character'.

        are you sure you tested with mssql.ddl? the token "character" only occurs in mysql.ddl ...

        Show
        Stefan Guggisberg added a comment - > 20080117-121337.671 ERROR [main] [] [DbFileSystem] failed to initialize file system > com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near 'character'. are you sure you tested with mssql.ddl? the token "character" only occurs in mysql.ddl ...
        Hide
        Guido Jäkel added a comment -

        Surprising or not – you're assumption is probabley wrong. As I know such "common root" talks, and I have alredy tested it against the mssql schema before, too. Sorry for my bad english, if this isn't clear from above.

        Here the sart of the stacktrace of the first error yielded with the mssql schema:

        20080117-121337.671 ERROR [main] [] [DbFileSystem] failed to initialize file system
        com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near 'character'.

        at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
        at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source)
        at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:225)
        at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:225)
        at org.apache.jackrabbit.core.fs.db.DatabaseFileSystem.checkSchema(DatabaseFileSystem.java:1169)
        ...

        Show
        Guido Jäkel added a comment - Surprising or not – you're assumption is probabley wrong. As I know such "common root" talks, and I have alredy tested it against the mssql schema before, too. Sorry for my bad english, if this isn't clear from above. Here the sart of the stacktrace of the first error yielded with the mssql schema: 20080117-121337.671 ERROR [main] [] [DbFileSystem] failed to initialize file system com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near 'character'. at com.sybase.jdbc3.tds.Tds.a(Unknown Source) at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:225) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:225) at org.apache.jackrabbit.core.fs.db.DatabaseFileSystem.checkSchema(DatabaseFileSystem.java:1169) ...
        Hide
        Stefan Guggisberg added a comment - - edited

        AFAIK, sybase and mssql ddl syntax is pretty similar
        (not that surprising, knowing their common roots .

        see e.g.
        http://db.apache.org/ddlutils/databases/sybase.html
        http://db.apache.org/ddlutils/databases/sqlserver.html

        chances are pretty good that the existing mssql.ddl files
        also work with sybase.

        i don't have a sybase server at hand so i can't test it myself.

        it would be great if you could test my assumption and report your
        findings.

        if the mssql.ddl files don't work for sybase i'd be happy to accept
        patches for sybase support

        Show
        Stefan Guggisberg added a comment - - edited AFAIK, sybase and mssql ddl syntax is pretty similar (not that surprising, knowing their common roots . see e.g. http://db.apache.org/ddlutils/databases/sybase.html http://db.apache.org/ddlutils/databases/sqlserver.html chances are pretty good that the existing mssql.ddl files also work with sybase. i don't have a sybase server at hand so i can't test it myself. it would be great if you could test my assumption and report your findings. if the mssql.ddl files don't work for sybase i'd be happy to accept patches for sybase support

          People

          • Assignee:
            Unassigned
            Reporter:
            Guido Jäkel
          • Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development