Class OraclePersistenceManager
- java.lang.Object
-
- org.apache.jackrabbit.core.persistence.AbstractPersistenceManager
-
- org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager
-
- org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager
-
- org.apache.jackrabbit.core.persistence.db.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-basedPersistenceManager
for Jackrabbit that persistsItemState
andNodeReferences
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 userpassword
: the user's passwordschemaObjectPrefix
: prefix to be prepended to schema objectstableSpace
: the tablespace to useexternalBLOBs
: iftrue
(the default) BINARY values (BLOBs) are stored in the local file system; iffalse
BLOBs are stored in the database
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
Fields Modifier and Type Field Description static String
TABLE_SPACE_VARIABLE
Deprecated.the variable for the Oracle table spaceprotected 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
Constructors Constructor Description OraclePersistenceManager()
Deprecated.Creates a newOraclePersistenceManager
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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
-
-
-
-
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
-
-
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 theDURATION_SESSION
andMODE_READWRITE
constants defined there.- Specified by:
init
in interfacePersistenceManager
- Overrides:
init
in classDatabasePersistenceManager
- 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
PreparedStatement
s 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 classDatabasePersistenceManager
- 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
PreparedStatement
s 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 classDatabasePersistenceManager
- 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
PreparedStatement
s 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 classDatabasePersistenceManager
- 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 classDatabasePersistenceManager
- 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
-
-