Class OraclePersistenceManager

  • All Implemented Interfaces:
    PersistenceManager, DatabaseAware

    @Deprecated
    public class OraclePersistenceManager
    extends SimpleDbPersistenceManager
    Deprecated.
    Please migrate to a bundle persistence manager (JCR-2802)
    OraclePersistenceManager is a JDBC-based PersistenceManager for Jackrabbit that persists ItemState and NodeReferences objects in Oracle database using a simple custom serialization format and a very basic non-normalized database schema (in essence tables with one 'key' and one 'data' column).

    It is configured through the following properties:

    • driver: the FQN name of the JDBC driver class (default: "oracle.jdbc.OracleDriver")
    • schema: type of schema to be used (default: "oracle")
    • url: the database url (e.g. "jdbc:oracle:thin:@[host]:[port]:[sid]")
    • user: the database user
    • password: the user's password
    • schemaObjectPrefix: prefix to be prepended to schema objects
    • tableSpace: the tablespace to use
    • externalBLOBs: if true (the default) BINARY values (BLOBs) are stored in the local file system; if false BLOBs are stored in the database
    See also SimpleDbPersistenceManager.

    The following is a fragment from a sample configuration:

       <PersistenceManager class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
           <param name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl"/>
           <param name="user" value="scott"/>
           <param name="password" value="tiger"/>
           <param name="schemaObjectPrefix" value="${wsp.name}_"/>
           <param name="tableSpace" value=""/>
           <param name="externalBLOBs" value="false"/>
      </PersistenceManager>
     
    • Field Detail

      • TABLE_SPACE_VARIABLE

        public static final String TABLE_SPACE_VARIABLE
        Deprecated.
        the variable for the Oracle table space
        See Also:
        Constant Field Values
      • tableSpace

        protected String tableSpace
        Deprecated.
        the Oracle table space to use
    • Constructor Detail

      • OraclePersistenceManager

        public OraclePersistenceManager()
        Deprecated.
        Creates a new OraclePersistenceManager instance.
    • Method Detail

      • getTableSpace

        public String getTableSpace()
        Deprecated.
        Returns the configured Oracle table space.
        Returns:
        the configured Oracle table space.
      • setTableSpace

        public void setTableSpace​(String tableSpace)
        Deprecated.
        Sets the Oracle table space.
        Parameters:
        tableSpace - the Oracle table space.
      • init

        public void init​(PMContext context)
                  throws Exception
        Deprecated.
        Initializes the persistence manager. The persistence manager is permanently bound to the given context, and any required external resources are acquired.

        An appropriate exception is thrown if the persistence manager initialization fails for whatever reason. In this case the state of the persistence manager is undefined and the instance should be discarded.

        Retrieve the oracle.sql.BLOB class via reflection, and initialize the values for the DURATION_SESSION and MODE_READWRITE constants defined there.

        Specified by:
        init in interface PersistenceManager
        Overrides:
        init in class DatabasePersistenceManager
        Parameters:
        context - persistence manager context
        Throws:
        Exception - if the persistence manager initialization failed
      • store

        public void store​(NodeState state)
                   throws ItemStateException
        Deprecated.
        Store a node state. Subclass responsibility.

        This method uses shared PreparedStatements which must be executed strictly sequentially. Because this method synchronizes on the persistence manager instance there is no need to synchronize on the shared statement. If the method would not be synchronized the shared statements would have to be synchronized.

        Overrides:
        store in class DatabasePersistenceManager
        Parameters:
        state - node state to store
        Throws:
        ItemStateException - if an error occurs
      • store

        public void store​(PropertyState state)
                   throws ItemStateException
        Deprecated.
        Store a property state. Subclass responsibility.

        This method uses shared PreparedStatements which must be executed strictly sequentially. Because this method synchronizes on the persistence manager instance there is no need to synchronize on the shared statement. If the method would not be synchronized the shared statements would have to be synchronized.

        Overrides:
        store in class DatabasePersistenceManager
        Parameters:
        state - property state to store
        Throws:
        ItemStateException - if an error occurs
      • store

        public void store​(NodeReferences refs)
                   throws ItemStateException
        Deprecated.
        Store a references object. Subclass responsibility.

        This method uses shared PreparedStatements which must be executed strictly sequentially. Because this method synchronizes on the persistence manager instance there is no need to synchronize on the shared statement. If the method would not be synchronized the shared statements would have to be synchronized.

        Overrides:
        store in class DatabasePersistenceManager
        Parameters:
        refs - references object to store
        Throws:
        ItemStateException - if an error occurs
      • checkSchema

        protected void checkSchema()
                            throws Exception
        Deprecated.
        Checks if the required schema objects exist and creates them if they don't exist yet.

        Overridden in order to support multiple oracle schemas. Note that schema names in Oracle correspond to the username of the connection. See http://issues.apache.org/jira/browse/JCR-582

        Overrides:
        checkSchema in class DatabasePersistenceManager
        Throws:
        Exception - if an error occurs
      • createTemporaryBlob

        protected Blob createTemporaryBlob​(InputStream in)
                                    throws Exception
        Deprecated.
        Creates a temporary oracle.sql.BLOB instance via reflection and spools the contents of the specified stream.
        Throws:
        Exception
      • freeTemporaryBlob

        protected void freeTemporaryBlob​(Object blob)
                                  throws Exception
        Deprecated.
        Frees a temporary oracle.sql.BLOB instance via reflection.
        Throws:
        Exception