|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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
public class OraclePersistenceManager
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).
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>
| Field Summary | |
|---|---|
static String |
TABLE_SPACE_VARIABLE
the variable for the Oracle table space |
protected String |
tableSpace
the Oracle table space to use |
| Fields inherited from class org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager |
|---|
driver, password, url, user |
| Constructor Summary | |
|---|---|
OraclePersistenceManager()
Creates a new OraclePersistenceManager instance. |
|
| Method Summary | |
|---|---|
protected void |
checkSchema()
Checks if the required schema objects exist and creates them if they don't exist yet. |
protected Blob |
createTemporaryBlob(InputStream in)
Creates a temporary oracle.sql.BLOB instance via reflection and spools the contents of the specified stream. |
protected void |
freeTemporaryBlob(Object blob)
Frees a temporary oracle.sql.BLOB instance via reflection. |
String |
getTableSpace()
Returns the configured Oracle table space. |
void |
init(PMContext context)
Initializes the persistence manager. |
void |
setTableSpace(String tableSpace)
Sets the Oracle table space. |
void |
store(NodeReferences refs)
Store a references object. |
void |
store(NodeState state)
Store a node state. |
void |
store(PropertyState state)
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 |
|---|
public static final String TABLE_SPACE_VARIABLE
protected String tableSpace
| Constructor Detail |
|---|
public OraclePersistenceManager()
OraclePersistenceManager instance.
| Method Detail |
|---|
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 theoracle.sql.BLOB class via reflection, and
initialize the values for the DURATION_SESSION and
MODE_READWRITE constants defined there.
init in interface PersistenceManagerinit in class DatabasePersistenceManagercontext - persistence manager context
Exception - if the persistence manager initialization failedoracle.sql.BLOB#DURATION_SESSION,
oracle.sql.BLOB#MODE_READWRITE
public void store(NodeState state)
throws ItemStateException
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.
store in class DatabasePersistenceManagerstate - node state to store
ItemStateException - if an error occurs
public void store(PropertyState state)
throws ItemStateException
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.
store in class DatabasePersistenceManagerstate - property state to store
ItemStateException - if an error occurs
public void store(NodeReferences refs)
throws ItemStateException
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.
store in class DatabasePersistenceManagerrefs - references object to store
ItemStateException - if an error occurs
protected void checkSchema()
throws Exception
checkSchema in class DatabasePersistenceManagerException - if an error occurs
protected Blob createTemporaryBlob(InputStream in)
throws Exception
Exception
protected void freeTemporaryBlob(Object blob)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||