|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.AbstractStoreManager
org.datanucleus.store.db4o.DB4OStoreManager
public class DB4OStoreManager
Store Manager for DB4O (http://www.db4o.com).
DataNucleus will select this StoreManager with URLs of the form "db4o:...". Support for DB4O is for the following URLs
DB4O provides methods to hand out memory versions of the datastore objects. Each object has to be "activated" to have its values accessible. Similarly the object can be "deactivated" when it is no longer needed (freeing up resources, and the link to the disk object). When we retrieve an object from DB4O it activates the object. This makes all fields accessible. If however one of the fields is a PC object (or collection, or map, or array etc) that object itself is not activated. Consequently all fields are accessible from the start (unlike with RDBMS), but the StateManager manages the list of fields that are considered "loaded", and this is initially just those in the DFG (even though others are available). When the user accesses one of these "not-loaded" fields DB4OManager.fetchObject is called and that field is marked as loaded (if it is a SCO mutable it is wrapped, and if it is a PC object it has a StateManager connected and is activated).
Each object is persisted on its own, and we dont use DB4O's internal cascade mechanism. Instead the DB4OManager.insertObject, or DB4OManager.updateObject methods are called for each object that is to be persisted/updated. Each call to insertObject/updateObject provides reachability by use of PersistFieldManager.
Currently objects are deleted using DB4O's internal cascade mechanism.
Refer to ConnectionFactoryImpl. In simple terms each ObjectManager has a DB4O ObjectContainer associated with it, and this is retained until the end of life of the ObjectManager. With DB4O in server mode this allows use of multiple PMs on the same underlying datastore. With DB4O in file mode you can only have one PM operating on the same underlying datastore at once. This is a DB4O limitation rather than ours.
| Field Summary | |
|---|---|
protected static org.datanucleus.util.Localiser |
LOCALISER_DB4O
Localiser for messages. |
| Fields inherited from class org.datanucleus.store.AbstractStoreManager |
|---|
autoStartMechanism, connectionMgr, fixedDatastore, LOCALISER, nontxConnectionFactoryName, omfContext, persistenceHandler, persistenceHandler2, readOnlyDatastore, schemaHandler, starter, starterInitialised, storeDataMgr, storeManagerKey, storeManagerRuntime, txConnectionFactoryName, valueGenerationMgr |
| Constructor Summary | |
|---|---|
DB4OStoreManager(org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.OMFContext omfContext)
Constructor for a new DB4O StoreManager. |
|
| Method Summary | |
|---|---|
void |
activateObject(com.db4o.ObjectContainer cont,
java.lang.Object obj)
Convenience method to activate an object, to a depth of 1. |
void |
activateObject(com.db4o.ObjectContainer cont,
java.lang.Object obj,
int depth)
Convenience method to activate an object, to a depth. |
void |
close()
Release of resources |
void |
deactivateObject(com.db4o.ObjectContainer cont,
java.lang.Object obj)
Convenience method to deactivate an object, to a depth of 1. |
void |
deactivateObject(com.db4o.ObjectContainer cont,
java.lang.Object obj,
int depth)
Convenience method to activate an object, to a depth. |
void |
deregisterObjectContainer(com.db4o.ObjectContainer cont)
Method to deregister an ObjectContainer from this store. |
org.datanucleus.store.Extent |
getExtent(org.datanucleus.ObjectManager om,
java.lang.Class c,
boolean subclasses)
Accessor for an Extent for a class. |
java.lang.Object |
getObjectIdForObject(org.datanucleus.ObjectManager om,
java.lang.Object pc)
Convenience method to get the identity for a Persistable object. |
java.util.Collection |
getSupportedOptions()
Accessor for the supported options in string form |
boolean |
isStrategyDatastoreAttributed(org.datanucleus.metadata.IdentityStrategy identityStrategy,
boolean datastoreIdentityField)
Check if the strategy is attributed by the database when the PersistenceCapable object is inserted into the database. |
protected void |
logConfiguration()
Convenience method to log the configuration of this store manager. |
void |
notifyObjectIsOutdated(org.datanucleus.StateManager sm)
Hook for the StateManager to notify us that an object is outdated (no longer valid). |
void |
registerObjectContainer(com.db4o.ObjectContainer cont)
Method to register an ObjectContainer as active on this store. |
protected void |
registerStoreData(org.datanucleus.store.StoreData data)
Method to register some data with the store. |
| Methods inherited from class org.datanucleus.store.AbstractStoreManager |
|---|
addClass, addClasses, assertReadOnlyForUpdateOfObject, assertReadOnlyForUpdateOfObject, clearAutoStarter, deregisterAllStoreData, getApiAdapter, getBackingStoreForField, getClassNameForObjectID, getConnection, getConnection, getConnection, getConnection, getConnection, getConnectionDriverName, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactoryName, getConnectionManager, getConnectionPassword, getConnectionURL, getConnectionUserName, getDatastoreDate, getMetaDataManager, getNucleusConnection, getNucleusSequence, getOMFContext, getPersistenceHandler, getPersistenceHandler2, getPropertiesForGenerator, getQueryCacheKey, getRuntimeManager, getSchemaHandler, getStoreManagerKey, getStrategyForNative, getStrategyValue, getStrategyValueForGenerator, getSubClassesForClass, getValueGenerationManager, initialiseAutoStart, manageClassForIdentity, managesClass, newStoreData, performVersionCheck, printInformation, registerConnectionFactory, registerConnectionMgr, removeAllClasses, supportsQueryLanguage, supportsValueStrategy |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.datanucleus.util.Localiser LOCALISER_DB4O
| Constructor Detail |
|---|
public DB4OStoreManager(org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.OMFContext omfContext)
clr - the ClassLoaderResolveromfContext - The corresponding ObjectManagerFactory omfContext.| Method Detail |
|---|
public void close()
close in interface org.datanucleus.store.StoreManagerclose in class org.datanucleus.store.AbstractStoreManagerprotected void logConfiguration()
logConfiguration in class org.datanucleus.store.AbstractStoreManagerprotected void registerStoreData(org.datanucleus.store.StoreData data)
registerStoreData in class org.datanucleus.store.AbstractStoreManagerdata - The StoreData to addpublic void registerObjectContainer(com.db4o.ObjectContainer cont)
cont - ObjectContainerpublic void deregisterObjectContainer(com.db4o.ObjectContainer cont)
cont - ObjectContainerpublic void notifyObjectIsOutdated(org.datanucleus.StateManager sm)
notifyObjectIsOutdated in interface org.datanucleus.store.StoreManagernotifyObjectIsOutdated in class org.datanucleus.store.AbstractStoreManagersm - StateManager of object
public void activateObject(com.db4o.ObjectContainer cont,
java.lang.Object obj)
cont - ObjectContainer where the object residesobj - The object
public void activateObject(com.db4o.ObjectContainer cont,
java.lang.Object obj,
int depth)
cont - ObjectContainer where the object residesobj - The objectdepth - The depth to activate to
public void deactivateObject(com.db4o.ObjectContainer cont,
java.lang.Object obj)
cont - ObjectContainer where the object residesobj - The object
public void deactivateObject(com.db4o.ObjectContainer cont,
java.lang.Object obj,
int depth)
cont - ObjectContainer where the object residesobj - The objectdepth - The depth to activate to
public java.lang.Object getObjectIdForObject(org.datanucleus.ObjectManager om,
java.lang.Object pc)
om - The Object Managerpc - The object
public boolean isStrategyDatastoreAttributed(org.datanucleus.metadata.IdentityStrategy identityStrategy,
boolean datastoreIdentityField)
isStrategyDatastoreAttributed in interface org.datanucleus.store.StoreManagerisStrategyDatastoreAttributed in class org.datanucleus.store.AbstractStoreManageridentityStrategy - the identityStrategydatastoreIdentityField - Whether this is for the surrogate datastore identity field
public org.datanucleus.store.Extent getExtent(org.datanucleus.ObjectManager om,
java.lang.Class c,
boolean subclasses)
getExtent in interface org.datanucleus.store.StoreManagergetExtent in class org.datanucleus.store.AbstractStoreManagerom - The Object Managerc - The class requiring the Extentsubclasses - Whether to include subclasses of 'c'
public java.util.Collection getSupportedOptions()
getSupportedOptions in interface org.datanucleus.store.StoreManagergetSupportedOptions in class org.datanucleus.store.AbstractStoreManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||