枚举常量
在 Database 类中定义了以下枚举值:
类定义
public class Database implements java.io.Closeable
{
public enum TransactionType
{
ReadOnly,
Update,
ReadWrite,
Exclusive
};
public enum TransactionPriority
{
Idle,
Background,
Foreground,
AboveNormal,
Highest
};
public enum IsolationLevel
{
Default,
ReadCommitted,
RepeatableRead,
Serializable
};
/* Transaction log types */
public enum LogType
{
NoLog,
RedoLog,
UndoLog
};
public enum IndexType
{
Hashtable,
BTree,
Patricia,
RTree,
RTreeOfPoint,
Trigram
}
static final String[] indexTypeName =
{"hash", "tree", "patricia", "rtree", "rtree", "trigram"};
public enum EventType
{
OnNew,
OnFieldUpdate,
OnDelete,
OnDeleteAll,
OnCheckpoint,
OnUpdate
}
static final String[] eventTypeName =
{"new", "update", "delete", "delete_all", "checkpoint", "update"};
public enum CommitPolicy
{
/**
* Wait until all changes are saved on disk. (the default policy)
*/
SyncFlush,
/**
* Do not flush changes to disk.
*/
Buffered, /* runtime buffered transactions */
/**
* Delay flushing changes to disk until the size of the changes or number of delayed transactions exceeds
* the specified threshold value.
*/
Delayed,
/**
* Flush changes to disk asynchronously.
*/
NoSync
};
public enum TransSchedPolicy
{
/**
* Honest policy: first-in first-out
*/
Fifo,
/**
* Place readers in queue before writers
*/
ReaderFavor,
/**
* Place writers in queue before readers
*/
WriterFavor
};
public enum BackupType
{
Auto,
Snapshot,
Incremental
};
...
}
定义
TransactionType:事务类型
TransactionPriority:事务优先级
IsolationLevel:隔离级别
TransSchedPolicy:事务调度策略
LogType:事务日志类型
IndexType:索引类型
EventType:事件类型
CommitPolicy:持久数据库事务提交策略
BackupType:增量备份类型