Berkeley db java edition getting started with transaction processing guide


















Further, JE uses timeouts for deadlock detection to help you ensure that two threads of control do not deadlock indefinitely. Moreover, JE allows multiple processes to access the same databases. However, in this configuration JE requires that there be no more than one process allowed to write to the database. Read-only processes are guaranteed a consistent, although potentially out of date, view of the stored data as of the time that the environment is opened. Transactions allow you to treat one or more operations on one or more databases as a single unit of work.

JE transactions offer the application developer recoverability, atomicity, and isolation for your database operations. Note that transaction protection is optional. In-memory cache. The cache will grow on demand up to a pre-configured maximum size.

Cache management is described in Sizing the Cache. JE allows you to easily create and maintain secondary indices for your primary data. In this way, you can obtain rapid access to your data through the use of an alternative, or secondary, key. How indices work is dependent upon the API you are using. Otherwise, see Secondary Databases. Log files. JE databases are stored in one or more numerically-named log files in the environment directory.

The log files are write-once and are portable across platforms with different endian-ness. Unlike other database implementations, there is no distinction between database files that is, the "material database" and log files. Instead JE employs a log-based storage system to protect database modifications. Before any change is made to a database, JE writes information about the change to the log file.

However, both products provide dump and load utilities, and the files that these operate on are compatible across product lines. Background threads. JE provides several threads that manage internal resources for you. The checkpointer is responsible for flushing database data to disk that was written to cache as the result of a transaction commit this is done in order to shorten recovery time.

The compressor thread removes subtrees from the database that are empty because of deletion activity. Finally, the cleaner thread is responsible for cleaning and removing unneeded log files, thereby helping you to save on disk space. Background thread management is described in Managing the Background Threads. Backup and restore. JE's backup procedure consists of simply copying JE's log files to a safe location for storage.

To recover from a catastrophic failure, you copy your archived log files back to your production location on disk and reopen the JE environment. Note that JE always performs normal recovery when it opens a database environment. Normal recovery brings the database to a consistent state based on change information found in the database log files. The DPL provides the ability to cause any Java type to be persistent without implementing special interfaces.

The only real requirement is that each persistent class have a default constructor. The DPL provides all of the features previously identified in this chapter.

In addition, the DPL offers you:. A type safe, convenient way to access persistent objects. No hand-coding of bindings is required.

A binding is a way of transforming data types into a format which can be stored in a JE database. If you do not use the DPL, you may be required to create custom bindings for your data types. No external schema is required to define primary and secondary index keys.

Java annotations are used to define all metadata. Interoperability with external components is supported using the Java collections framework. Any index can be accessed using a standard java. Class evolution is explicitly supported. This means you can add fields or widen types automatically and transparently. You can also perform many incompatible class changes, such as renaming fields or refactoring a single class. This is done using a built-in DPL mechanism called mutations.

Government or anyone licensing it on behalf of the U. Government, the following notice is applicable:. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. No other rights are granted to the U. This software or hardware is developed for general use in a variety of information management applications.

It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation.

This software or hardware and documentation may provide access to or information on content, products, and services from third parties.

Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services.



0コメント

  • 1000 / 1000