public interface FileConfiguration
FileConfigurationProvider.file()| Modifier and Type | Method and Description |
|---|---|
void |
asynchronousSync(boolean flag)
turns asynchronous sync on and off.
One of the most costly operations during commit is the call to flush the buffers of the database file. |
void |
blobPath(java.lang.String path)
configures the path to be used to store and read
Blob data.
|
void |
blockSize(int bytes)
sets the storage data blocksize for new ObjectContainers.
|
void |
databaseGrowthSize(int bytes)
configures the size database files should grow in bytes, when no
free slot is found within.
|
void |
disableCommitRecovery()
turns commit recovery off.
|
FreespaceConfiguration |
freespace()
returns the freespace configuration interface.
|
void |
generateCommitTimestamps(boolean flag)
Configures db4o to generate commit timestamps for all stored objects.
All the objects commited within a transaction will share the same commit timestamp. |
void |
generateUUIDs(ConfigScope setting)
configures db4o to generate UUIDs for stored objects.
|
void |
generateVersionNumbers(ConfigScope setting)
Deprecated.
As of version 8.0 please use
generateCommitTimestamps(boolean) instead. |
void |
lockDatabaseFile(boolean flag)
can be used to turn the database file locking thread off.
|
void |
readOnly(boolean flag)
turns readOnly mode on and off.
|
void |
recoveryMode(boolean flag)
turns recovery mode on and off.
Recovery mode can be used to try to retrieve as much as possible out of an already corrupted database. |
void |
reserveStorageSpace(long byteCount)
tuning feature only: reserves a number of bytes in database files.
|
Storage |
storage()
returns the configured
Storage. |
void |
storage(Storage storage)
allows to configure db4o to use a customized byte IO storage mechanism.
|
void blockSize(int bytes)
bytes - the size in bytes from 1 to 127void databaseGrowthSize(int bytes)
bytes - amount of bytesvoid disableCommitRecovery()
FreespaceConfiguration freespace()
void generateUUIDs(ConfigScope setting)
setting - the scope for UUID generation: disabled, generate for all classes, or configure individually@Deprecated void generateVersionNumbers(ConfigScope setting)
generateCommitTimestamps(boolean) instead.setting - the scope for version number generation: disabled, generate for all classes, or configure individuallyvoid generateCommitTimestamps(boolean flag)
ObjectContainer container = ...; ObjectInfo objectInfo = container.ext().getObjectInfo(obj); long commitTimestamp = objectInfo.getVersion();
flag - if true, commit timetamps will be generated for all stored
objects. If you already have commit timestamps for stored
objects and later set this flag to false, although you wont be
able to access them, the commit timestamps will still be taking
space in your file container. The only way to free that space
is defragmenting the container.void storage(Storage storage) throws GlobalOnlyConfigException
Storage to
write your own. Possible usecases could be improved performance
with a native library, mirrored write to two files, encryption or
read-on-write fail-safety control.storage - - the storageGlobalOnlyConfigExceptionFileStorage,
CachingStorage,
MemoryStoragevoid lockDatabaseFile(boolean flag)
true.flag - false to turn database file locking off.void reserveStorageSpace(long byteCount)
throws DatabaseReadOnlyException,
NotSupportedException
byteCount - the number of bytes to reserveDatabaseReadOnlyExceptionNotSupportedExceptionvoid blobPath(java.lang.String path)
throws java.io.IOException
path - the path to be usedjava.io.IOExceptionvoid readOnly(boolean flag)
Db4oEmbedded.openFile(EmbeddedConfiguration, String)
will open files.
flag - true for configuring readOnly mode for subsequent
calls to Db4o.openFile().
TODO: this is rather embedded + client than base?void recoveryMode(boolean flag)
flag - true to turn recover mode on.void asynchronousSync(boolean flag)