org.apache.jackrabbit.core.state.db
Class DerbyPersistenceManager
java.lang.Object
org.apache.jackrabbit.core.state.AbstractPersistenceManager
org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager
org.apache.jackrabbit.core.state.db.DerbyPersistenceManager
- All Implemented Interfaces:
- PersistenceManager
- public class DerbyPersistenceManager
- extends SimpleDbPersistenceManager
DerbyPersistenceManager
is a JDBC-based
PersistenceManager
for Jackrabbit that persists
ItemState
and NodeReferences
objects in an
embedded Derby 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:
url
: the database url of the form
"jdbc:derby:[db];[attributes]"
schemaObjectPrefix
: prefix to be prepended to schema objects
driver
: the FQN name of the JDBC driver class
(default: "org.apache.derby.jdbc.EmbeddedDriver"
)
schema
: type of schema to be used
(default: "derby"
)
user
: the database user (default: ""
)
password
: the user's password (default: ""
)
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.state.db.DerbyPersistenceManager">
<param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
<param name="schemaObjectPrefix" value="${wsp.name}_"/>
<param name="externalBLOBs" value="false"/>
</PersistenceManager>
Fields inherited from class org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager |
blobDelete, blobFS, blobInsert, blobSelect, blobSelectExist, blobStore, blobUpdate, con, driver, externalBLOBs, INITIAL_BUFFER_SIZE, initialized, nodeReferenceDelete, nodeReferenceInsert, nodeReferenceSelect, nodeReferenceSelectExist, nodeReferenceUpdate, nodeStateDelete, nodeStateInsert, nodeStateSelect, nodeStateSelectExist, nodeStateUpdate, password, propertyStateDelete, propertyStateInsert, propertyStateSelect, propertyStateSelectExist, propertyStateUpdate, schema, SCHEMA_OBJECT_PREFIX_VARIABLE, schemaObjectPrefix, url, user |
Method Summary |
void |
close()
Closes the persistence manager. The consistency of the persistent
storage is guaranteed and all acquired resources are released.
It is an error to invoke any methods on a closed persistence manager,
and implementations are free to enforce this constraint by throwing
IllegalStateExceptions in such cases.
An appropriate exception is thrown if the persistence manager
could not be closed properly. In this case the state of the
persistence manager is undefined and the instance should be
discarded.
Overridden in order to properly shutdown the embedded Derby database. |
Methods inherited from class org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager |
checkSchema, closeResultSet, closeStatement, closeStream, destroy, destroy, destroy, exists, exists, exists, getDriver, getPassword, getSchema, getSchemaObjectPrefix, getUrl, getUser, init, isExternalBLOBs, load, load, load, logException, prepareSchemaObjectPrefix, resetStatement, setDriver, setExternalBLOBs, setExternalBLOBs, setPassword, setSchema, setSchemaObjectPrefix, setUrl, setUser, store, store, store, store |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DerbyPersistenceManager
public DerbyPersistenceManager()
- Creates a new
SimpleDbPersistenceManager
instance.
close
public void close()
throws Exception
- Closes the persistence manager. The consistency of the persistent
storage is guaranteed and all acquired resources are released.
It is an error to invoke any methods on a closed persistence manager,
and implementations are free to enforce this constraint by throwing
IllegalStateExceptions in such cases.
An appropriate exception is thrown if the persistence manager
could not be closed properly. In this case the state of the
persistence manager is undefined and the instance should be
discarded.
Overridden in order to properly shutdown the embedded Derby database.
- Specified by:
close
in interface PersistenceManager
- Overrides:
close
in class SimpleDbPersistenceManager
- Throws:
Exception
Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.