public class DerbyPersistenceManager extends BundleDbPersistenceManager
BundleDbPersistenceManager by derby specific code.
Configuration:bundleCacheSize" value="8"/>
consistencyCheck" value="false"/>
minBlobSize" value="16384"/>
driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
url" value="jdbc:derby:${wsp.home}/db/itemState;create=true"/>
user" value=""/>
password" value=""/>
schema" value="derby"/>
schemaObjectPrefix" value=""/>
errorHandling" value=""/>
derbyStorageInitialPages" value="16"/>
derbyStorageMinimumRecordSize" value="256"/>
derbyStoragePageCacheSize" value="1024"/>
derbyStoragePageReservedSpace" value="20"/>
derbyStoragePageSize" value="16384"/>
BundleDbPersistenceManager.CloseableBLOBStore, BundleDbPersistenceManager.DbBlobStore, BundleDbPersistenceManager.FSBlobStore| Modifier and Type | Field and Description |
|---|---|
static String |
DERBY_EMBEDDED_DRIVER
name of the embedded driver
|
binding, blobStore, blockOnConnectionLoss, bundleDeleteSQL, bundleInsertSQL, bundleSelectAllBundlesFromSQL, bundleSelectAllBundlesSQL, bundleSelectAllIdsFromSQL, bundleSelectAllIdsSQL, bundleSelectSQL, bundleUpdateSQL, conHelper, consistencyCheck, consistencyFix, databaseType, dataSourceName, driver, errorHandling, externalBLOBs, INITIAL_BUFFER_SIZE, initialized, nodeReferenceDeleteSQL, nodeReferenceInsertSQL, nodeReferenceSelectSQL, nodeReferenceUpdateSQL, password, schemaObjectPrefix, SM_BINARY_KEYS, SM_LONGLONG_KEYS, url, usercontext, NODEFILENAME, NODEREFSFILENAME, RES_NAME_INDEX, RES_NS_INDEXACCESS_INTERVAL| Constructor and Description |
|---|
DerbyPersistenceManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the given connection by shutting down the embedded Derby
database.
|
protected ConnectionHelper |
createConnectionHelper(DataSource dataSrc)
This method is called from the
BundleDbPersistenceManager.init(PMContext) method of this class and returns a
ConnectionHelper instance which is assigned to the conHelper field. |
String |
getDerbyStorageInitialPages() |
String |
getDerbyStorageMinimumRecordSize() |
String |
getDerbyStoragePageCacheSize() |
String |
getDerbyStoragePageReservedSpace() |
String |
getDerbyStoragePageSize() |
int |
getStorageModel()
returns the storage model
|
void |
init(PMContext context)
Initializes the persistence manager.
|
void |
setDerbyStorageInitialPages(String derbyStorageInitialPages)
The on-disk size of a Derby table grows by one page at a time until eight
pages of user data (or nine pages of total disk use, one is used for
overhead) have been allocated.
|
void |
setDerbyStorageMinimumRecordSize(String derbyStorageMinimumRecordSize)
Indicates the minimum user row size in bytes for on-disk database pages
for tables when you are creating a table.
|
void |
setDerbyStoragePageCacheSize(String derbyStoragePageCacheSize)
Defines the size, in number of pages, of the database's data page cache
(data pages kept in memory).
|
void |
setDerbyStoragePageReservedSpace(String derbyStoragePageReservedSpace)
Defines the percentage of space reserved for updates on an on-disk
database page for tables only (not indexes); indicates the percentage of
space to keep free on a page when inserting.
|
void |
setDerbyStoragePageSize(String derbyStoragePageSize)
Defines the page size, in bytes, for on-disk database pages for tables or
indexes used during table or index creation.
|
buildSQLStatements, createBlobStore, createCheckSchemaOperation, createDBBlobStore, createDbNameIndex, createLocalFSBlobStore, createParams, destroy, destroyBundle, existsReferencesTo, getAllNodeIds, getAllNodeInfos, getBlobStore, getBlockOnConnectionLoss, getConsistencyCheck, getConsistencyFix, getDatabaseType, getDataSourceName, getDriver, getErrorHandling, getKey, getMinBlobSize, getNameIndex, getPassword, getSchema, getSchemaObjectPrefix, getUrl, getUser, isExternalBLOBs, isSchemaCheckEnabled, loadBundle, loadReferencesTo, setBlockOnConnectionLoss, setConnectionFactory, setConsistencyCheck, setConsistencyFix, setDatabaseType, setDataSourceName, setDriver, setErrorHandling, setExternalBLOBs, setMinBlobSize, setPassword, setSchema, setSchemaCheckEnabled, setSchemaObjectPrefix, setUrl, setUser, store, store, storeBundle, toString, useDbBlobStore, useLocalFsBlobStorebuildBlobFilePath, buildNodeFilePath, buildNodeFolderPath, buildNodeReferencesFilePath, buildPropFilePath, cacheAccessed, check, checkConsistency, createNew, createNew, disposeCache, evictBundle, exists, exists, getBundleCacheSize, getNsIndex, load, load, onExternalUpdate, setBundleCacheSizepublic static final String DERBY_EMBEDDED_DRIVER
public String getDerbyStorageInitialPages()
setDerbyStorageInitialPages(java.lang.String)public void setDerbyStorageInitialPages(String derbyStorageInitialPages)
16derbyStorageInitialPages - the number of initial pagespublic String getDerbyStorageMinimumRecordSize()
setDerbyStorageMinimumRecordSize(java.lang.String)public void setDerbyStorageMinimumRecordSize(String derbyStorageMinimumRecordSize)
256derbyStorageMinimumRecordSize - the minimum record sizepublic String getDerbyStoragePageCacheSize()
setDerbyStoragePageCacheSize(java.lang.String)public void setDerbyStoragePageCacheSize(String derbyStoragePageCacheSize)
setDerbyStoragePageCacheSize(java.lang.String))
setDerbyStoragePageSize(java.lang.String))
1024 (which gives about 16mb memory usage given
the default of 16384 as page size).derbyStoragePageCacheSize - the page cache sizepublic String getDerbyStoragePageReservedSpace()
setDerbyStoragePageReservedSpace(java.lang.String)public void setDerbyStoragePageReservedSpace(String derbyStoragePageReservedSpace)
20%derbyStoragePageReservedSpace - the page reserved spacepublic String getDerbyStoragePageSize()
setDerbyStoragePageSize(java.lang.String)public void setDerbyStoragePageSize(String derbyStoragePageSize)
16384derbyStoragePageSize - the storage page sizepublic 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. Initializes the internal structures of this abstract persistence manager.
init in interface PersistenceManagerinit in class BundleDbPersistenceManagercontext - persistence manager contextException - if the persistence manager initialization failedprotected ConnectionHelper createConnectionHelper(DataSource dataSrc)
BundleDbPersistenceManager.init(PMContext) method of this class and returns a
ConnectionHelper instance which is assigned to the conHelper field. Subclasses may
override it to return a specialized connection helper.createConnectionHelper in class BundleDbPersistenceManagerdataSrc - the DataSource of this persistence managerConnectionHelperpublic int getStorageModel()
getStorageModel in class BundleDbPersistenceManagerBundleDbPersistenceManager.SM_LONGLONG_KEYSpublic void close()
throws Exception
close in interface PersistenceManagerclose in class BundleDbPersistenceManagerSQLException - if an error occursException - if the persistence manager failed to close properlyDatabasePersistenceManager#closeConnection(Connection)Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.