org.apache.jackrabbit.core.persistence.db
Class OraclePersistenceManager

java.lang.Object
  extended by org.apache.jackrabbit.core.persistence.AbstractPersistenceManager
      extended by org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager
          extended by org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager
              extended by org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager
All Implemented Interfaces:
PersistenceManager, DatabaseAware

Deprecated. Please migrate to a bundle persistence manager (JCR-2802)

@Deprecated
public class OraclePersistenceManager
extends SimpleDbPersistenceManager

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:

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 Summary
static String TABLE_SPACE_VARIABLE
          Deprecated. the variable for the Oracle table space
protected  String tableSpace
          Deprecated. the Oracle table space to use
 
Fields inherited from class org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager
driver, password, url, user
 
Fields inherited from class org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager
autoReconnect, blobDeleteSQL, blobFS, blobInsertSQL, blobSelectExistSQL, blobSelectSQL, blobStore, blobUpdateSQL, con, externalBLOBs, INITIAL_BUFFER_SIZE, initialized, nodeReferenceDeleteSQL, nodeReferenceInsertSQL, nodeReferenceSelectExistSQL, nodeReferenceSelectSQL, nodeReferenceUpdateSQL, nodeStateDeleteSQL, nodeStateInsertSQL, nodeStateSelectExistSQL, nodeStateSelectSQL, nodeStateUpdateSQL, propertyStateDeleteSQL, propertyStateInsertSQL, propertyStateSelectExistSQL, propertyStateSelectSQL, propertyStateUpdateSQL, schema, SCHEMA_OBJECT_PREFIX_VARIABLE, schemaObjectPrefix, SLEEP_BEFORE_RECONNECT
 
Constructor Summary
OraclePersistenceManager()
          Deprecated. Creates a new OraclePersistenceManager instance.
 
Method Summary
protected  void checkSchema()
          Deprecated. Checks if the required schema objects exist and creates them if they don't exist yet.
protected  Blob createTemporaryBlob(InputStream in)
          Deprecated. Creates a temporary oracle.sql.BLOB instance via reflection and spools the contents of the specified stream.
protected  void freeTemporaryBlob(Object blob)
          Deprecated. Frees a temporary oracle.sql.BLOB instance via reflection.
 String getTableSpace()
          Deprecated. Returns the configured Oracle table space.
 void init(PMContext context)
          Deprecated. Initializes the persistence manager.
 void setTableSpace(String tableSpace)
          Deprecated. Sets the Oracle table space.
 void store(NodeReferences refs)
          Deprecated. Store a references object.
 void store(NodeState state)
          Deprecated. Store a node state.
 void store(PropertyState state)
          Deprecated. Store a property state.
 
Methods inherited from class org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager
getConnection, getDriver, getPassword, getUrl, getUser, setConnectionFactory, setDriver, setPassword, setUrl, setUser
 
Methods inherited from class org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager
buildSQLStatements, close, closeConnection, closeResultSet, closeStatement, createSchemaSql, destroy, destroy, destroy, executeStmt, exists, exists, existsReferencesTo, getSchema, getSchemaDDL, getSchemaObjectPrefix, initConnection, initPreparedStatements, isExternalBLOBs, isSchemaCheckEnabled, load, load, loadReferencesTo, logException, prepareSchemaObjectPrefix, reestablishConnection, resetStatement, setExternalBLOBs, setExternalBLOBs, setSchema, setSchemaCheckEnabled, setSchemaObjectPrefix, store
 
Methods inherited from class org.apache.jackrabbit.core.persistence.AbstractPersistenceManager
checkConsistency, createNew, createNew
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
See Also:
oracle.sql.BLOB#DURATION_SESSION, oracle.sql.BLOB#MODE_READWRITE

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


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.