Introduction

This document describes Java Object Base (JOB), an API providing persistence in Java. The API consists of a set of Java interfaces and an exception class. It facilitates managing objects in persistent maps. An implementation is provided proofing that the ideas introduced here are realizable.

Persistence has been discussed in the Java community for a long time. Several standards have been developed for this purpose, solving the problem with different objections.

Object serialization focuses on writing objects into streams and is completely realized in Java terms. Application classes implement the JDK interface Serializable marking a class as capable for object serialization. JDK provides two classes managing object serialization, ObjectOutputStream and ObjectInputStream . Although these classes provide a powerful concept for serializing object graphs, they do not solve the problem of efficiently storing a graph. As a consequence, applications must deserialize object graphs completely, even if they only access one particular object of a graph. These JDK classes do not store object graphs within transactional contexts. Thus, they can not rollback operations in case of failures.

Java To Database Connectivity (JDBC) is an API managing persistent data in relational database management systems (RDBMS). Applications access data in RDBMS through JDBC drivers implementing the API. JDBC drivers accept application requests as SQL command strings. As a consequence, applications must provide some object-relational mapping, determining how object fields are stored into database columns. Object-relational mappings are difficult to maintain and applications need tool support for this purpose.

Java Data Objects (JDO) is an API transparently managing persistent objects in arbitrary datastores. The API does not make any assumptions on specific datastores. Thus, JDO implementations may be built on top of JDBC providing an object-relational mapping, or they may be built on top of object database systems. Transparency is realized by class file enhancement. For this purpose, a byte code enhancer changes class files of application classes adding code for storing and retrieving objects. These changes are based on information stored in XML files defining persistence capable classes.

In order to define persistence, JOB introduces the concept of persistent maps extending JDK maps. Since semantics of JDK maps are well understood, the programming model for JOB applications is quite easy to learn. Combining the advantages of the APIs discussed above, JOB manages persistent data in the context of transactions, JOB completely realizes persistence in the context of Java, and JOB does not make any assumptions on specific datastores.

This document assumes that the reader is familiar with the Java programming language and with the JDK libraries, in particular JDK maps. Knowledge about the factory pattern and about common concepts of database theory such as transactions are helpful for understanding the ideas discussed here.