@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:
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
: if true
(the default) BINARY
values (BLOBs) are stored in the local file system;
if false
BLOBs are stored in the databaseSimpleDbPersistenceManager
.
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>
Modifier and Type | Field and Description |
---|---|
static String |
TABLE_SPACE_VARIABLE
Deprecated.
the variable for the Oracle table space
|
protected String |
tableSpace
Deprecated.
the Oracle table space to use
|
driver, password, url, user
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 and Description |
---|
OraclePersistenceManager()
Deprecated.
Creates a new
OraclePersistenceManager instance. |
Modifier and Type | Method and 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.
|
getConnection, getDriver, getPassword, getUrl, getUser, setConnectionFactory, setDriver, setPassword, setUrl, setUser
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
checkConsistency, createNew, createNew
public static final String TABLE_SPACE_VARIABLE
protected String tableSpace
public OraclePersistenceManager()
OraclePersistenceManager
instance.public String getTableSpace()
public void setTableSpace(String tableSpace)
tableSpace
- the Oracle table space.public void init(PMContext context) throws Exception
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.
init
in interface PersistenceManager
init
in class DatabasePersistenceManager
context
- persistence manager contextException
- if the persistence manager initialization failedpublic void store(NodeState state) throws ItemStateException
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.
store
in class DatabasePersistenceManager
state
- node state to storeItemStateException
- if an error occurspublic void store(PropertyState state) throws ItemStateException
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.
store
in class DatabasePersistenceManager
state
- property state to storeItemStateException
- if an error occurspublic void store(NodeReferences refs) throws ItemStateException
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.
store
in class DatabasePersistenceManager
refs
- references object to storeItemStateException
- if an error occursprotected void checkSchema() throws Exception
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
checkSchema
in class DatabasePersistenceManager
Exception
- if an error occursprotected Blob createTemporaryBlob(InputStream in) throws Exception
Exception
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.