Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-1525

Jackrabbit depends on Oracle driver for BLOB support in Oracle versions previous than 10.2

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta5
    • Fix Version/s: 2.0-beta6
    • Component/s: jackrabbit-core
    • Labels:
      None

      Description

      In Oracle versions previous to 10.2, Jackrabbit explicitly uses a class from the Oracle driver to provide BLOB support (see OracleFileSystem.init()). This special handling is no longer necesary for Oracle 10.2+, so we should provide a new implementation. As discussed on the list, we can create a new class for Oracle 10.2+, make it inherit from DbFileSystem, and override the createSchema(), and table space related methods, which are the ones that need special handling. Furthermore, we could refactor the current OracleFileSystem and break it into two clases, one of them to keep the current behavior and a new one to keep the common code (which we could rename to OracleBaseFileSystem or similar, to maintain compatiblity with code that uses OracleFileSystem for versions previous to 10.2). Then we make the Oracle10FileSystem inherit from the latter.

      1. JCR-1525.patch
        3 kB
        Martijn Hendriks
      2. JCR-1525.patch
        51 kB
        Jared Roberts
      3. JCR-1525.patch
        27 kB
        Esteban Franqueiro

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        456d 15h 59m 1 Jukka Zitting 08/Jul/09 11:43
        Patch Available Patch Available Resolved Resolved
        152d 16m 1 Martijn Hendriks 07/Dec/09 10:59
        Resolved Resolved Closed Closed
        44d 6h 50m 1 Jukka Zitting 20/Jan/10 17:49
        Jukka Zitting made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jukka Zitting made changes -
        Fix Version/s 2.0-beta6 [ 12314522 ]
        Fix Version/s 2.0.0 [ 12312449 ]
        Jukka Zitting made changes -
        Affects Version/s 2.0-beta5 [ 12314459 ]
        Hide
        Sébastien Launay added a comment -

        > Please note that this change is not backwards compatible: the OracleFileSystem class now does not use special blob handling required for 10R1 and earlier. If you need that, use the Oracle9FileSystem. We migh want to add this in the RELEASE-NOTES.txt.

        Done in revision 888290.

        Show
        Sébastien Launay added a comment - > Please note that this change is not backwards compatible: the OracleFileSystem class now does not use special blob handling required for 10R1 and earlier. If you need that, use the Oracle9FileSystem. We migh want to add this in the RELEASE-NOTES.txt. Done in revision 888290.
        Martijn Hendriks made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Assignee Martijn Hendriks [ martijnh ]
        Fix Version/s 2.0.0 [ 12312449 ]
        Resolution Fixed [ 1 ]
        Hide
        Martijn Hendriks added a comment -

        Fixed in revision: 887881.

        Please note that this change is not backwards compatible: the OracleFileSystem class now does not use special blob handling required for 10R1 and earlier. If you need that, use the Oracle9FileSystem. We migh want to add this in the RELEASE-NOTES.txt.

        Show
        Martijn Hendriks added a comment - Fixed in revision: 887881. Please note that this change is not backwards compatible: the OracleFileSystem class now does not use special blob handling required for 10R1 and earlier. If you need that, use the Oracle9FileSystem. We migh want to add this in the RELEASE-NOTES.txt.
        Martijn Hendriks made changes -
        Attachment JCR-1525.patch [ 12427096 ]
        Hide
        Martijn Hendriks added a comment -

        Attached a new version of the proposed patch because the previous ones do not match anymore after the JCR-1456 merge.

        Show
        Martijn Hendriks added a comment - Attached a new version of the proposed patch because the previous ones do not match anymore after the JCR-1456 merge.
        Martijn Hendriks made changes -
        Assignee Martijn Hendriks [ martijnh ]
        Jared Roberts made changes -
        Attachment JCR-1525.patch [ 12413160 ]
        Hide
        Jared Roberts added a comment -

        I took the liberty of updating the patch with a couple of modifications. The first is to rename the classes to align with the conventions that Thomas mentioned. Instead of Oracle9FileSystem, I chose Oracle10R1FileSystem, though. It seemed to make more sense, because that's technically the last version it supports. The second change I made was to remove the user/password initialization in the OracleBaseFileSystem constructor. Initializing them to empty strings causes problems when a JNDI data source is being used. They should be left null unless explicitly configured.

        Show
        Jared Roberts added a comment - I took the liberty of updating the patch with a couple of modifications. The first is to rename the classes to align with the conventions that Thomas mentioned. Instead of Oracle9FileSystem, I chose Oracle10R1FileSystem, though. It seemed to make more sense, because that's technically the last version it supports. The second change I made was to remove the user/password initialization in the OracleBaseFileSystem constructor. Initializing them to empty strings causes problems when a JNDI data source is being used. They should be left null unless explicitly configured.
        Jukka Zitting made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Jukka Zitting made changes -
        Workflow jira [ 12428366 ] no-reopen-closed, patch-avail [ 12467745 ]
        Hide
        Thomas Mueller added a comment -

        +1 for the patch except:

        The class names should match the names used in the bundle PMs. Currently the patch uses:
        Oracle10R2FileSystem (for Oracle 10 and newer)
        OracleFileSystem (for Oracle 9)

        The class names should be:
        OracleFileSystem (for Oracle 10 and newer)
        Oracle9FileSystem (for Oracle 9)

        Show
        Thomas Mueller added a comment - +1 for the patch except: The class names should match the names used in the bundle PMs. Currently the patch uses: Oracle10R2FileSystem (for Oracle 10 and newer) OracleFileSystem (for Oracle 9) The class names should be: OracleFileSystem (for Oracle 10 and newer) Oracle9FileSystem (for Oracle 9)
        Serge Huber made changes -
        Comment [ Actually in the most recent versions of the Oracle driver (11) we no longer need the Oracle BLOB specific code. And the new driver solves this even for older versions of Oracle. If you're interested I have a patch for that also. But it's not clear to me if it's acceptable to Jackrabbit to have a dependency on the latest version of the driver ?

        Here is the extract from the README for the new driver :

        "New Factory Methods
        The JDBC 4.0 spec for java.sql.Connection includes factory methods
        for creating instances of the standard JDBC types, Array, Blob,
        Clob, etc. Building on this concept Oracle JDBC 11R1
        oracle.jdbc.OracleConnection provides factory methods for creating
        instances of the Oracle specific types. Best practice is to use
        the standard JDBC types and the new factory methods. When it is
        necessary to use the Oracle specific types best practice is to
        create them via the new factory methods. Direct customer access to
        the the constructors for these types will be deprecated and later
        desupported. The supported types are all those in oracle.sql,
        including ARRAY, BFILE, DATE, INTERVALDS, NUMBER, STRUCT, TIME,
        TIMESTAMP, etc."

        Regards,
          Serge ]
        Hide
        Martijn Hendriks added a comment -

        We've been running your patch also and encountered no problems. It looks fine. +1 for committing the patch.

        Can we solve the naming inconsistency now that the trunk is on 2.0-SNAPSHOT?

        Show
        Martijn Hendriks added a comment - We've been running your patch also and encountered no problems. It looks fine. +1 for committing the patch. Can we solve the naming inconsistency now that the trunk is on 2.0-SNAPSHOT?
        Hide
        Esteban Franqueiro added a comment -

        Hi all.
        What should we do regarding this issue? I've been running this code for some time now and haven't had any issues. Should we apply it to trunk? Or should we wait?
        Regards,

        Show
        Esteban Franqueiro added a comment - Hi all. What should we do regarding this issue? I've been running this code for some time now and haven't had any issues. Should we apply it to trunk? Or should we wait? Regards,
        Esteban Franqueiro made changes -
        Field Original Value New Value
        Attachment JCR-1525.patch [ 12380528 ]
        Hide
        Esteban Franqueiro added a comment -

        This patch applies the suggested fix. We should decide what to do regarding what I mentioned in my previous comments.
        As suggested by Thomas, this doesn't include changes for the older PMs.
        I tested it on Oracle 10.2.0.3.0 and all tests passed.

        Show
        Esteban Franqueiro added a comment - This patch applies the suggested fix. We should decide what to do regarding what I mentioned in my previous comments. As suggested by Thomas, this doesn't include changes for the older PMs. I tested it on Oracle 10.2.0.3.0 and all tests passed.
        Hide
        Thomas Mueller added a comment -

        Hi,
        I don't know how much it is used. I would deprecate those persistence managers soon, as they are much slower then the bundle persistence managers. So in my view it doesn't make sense to work on non-bundle persistence managers any more.
        Regards,
        Thomas

        Show
        Thomas Mueller added a comment - Hi, I don't know how much it is used. I would deprecate those persistence managers soon, as they are much slower then the bundle persistence managers. So in my view it doesn't make sense to work on non-bundle persistence managers any more. Regards, Thomas
        Hide
        Esteban Franqueiro added a comment -

        Is it worth doing this work for the Oracle DB Persistence Managers (not the bundle PMs) too?
        The bundle PMs for Oracle already support 10.2+, but there's a name mismatch because there's an Oracle9PM, and OraclePM is for 10+.

        Show
        Esteban Franqueiro added a comment - Is it worth doing this work for the Oracle DB Persistence Managers (not the bundle PMs) too? The bundle PMs for Oracle already support 10.2+, but there's a name mismatch because there's an Oracle9PM, and OraclePM is for 10+.
        Hide
        Esteban Franqueiro added a comment -

        I'm working on this refactoring and I ended up with an empty Oracle10R2FileSystem. From a code point of view this class should be removed, but from a user's perspective, I think its more clear to have a class with a more accurate name.
        The other possibility is to rename the already mentioned OracleBaseFaileSystem as Oracle10R2FileSystem, and make OracleFileSystem inheriit from it. I don't like this either.
        WDYYT?
        Regards,

        Show
        Esteban Franqueiro added a comment - I'm working on this refactoring and I ended up with an empty Oracle10R2FileSystem. From a code point of view this class should be removed, but from a user's perspective, I think its more clear to have a class with a more accurate name. The other possibility is to rename the already mentioned OracleBaseFaileSystem as Oracle10R2FileSystem, and make OracleFileSystem inheriit from it. I don't like this either. WDYYT? Regards,
        Esteban Franqueiro created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Esteban Franqueiro
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development