Show TOC Start of Content Area

Background documentation Architecture Overview  Locate the document in its SAP Library structure

The JDO standard is designed to enable Java applications to store objects transparantly to a persistent data store, as well as to provide them with a Java-centric view of persistent data. This aim may be achieved in either of the environments that the JDO specification defines for a JDO-aware application:

·        Non-managed (two-tier) environment

A non-managed environment implies a standalone JDO implementation – that is, the implementation runs outside an application server. This is a scenario in which the application itself manages the access to the underlying datastore. The application developer has to configure a PersistenceManagerFactory and to implement transaction and connection management functions in the application code. The security features are provided on the data store side – that is, the application uses a username and password valid for the datastore to log on to the datastore server.

·        Managed (application server) environment

In this environment, the JDO implementation is integrated in a J2EE application server, which manages connectivity, transactions and security when accessing the data store. The applications use a preconfigured PersistenceManagerFactory, which they look up from the naming system. The application itself is not required to implement transaction management, although it may start datastore transactions in certain cases.

We can consider the JDO architecture in a managed environment from two perspectives:

¡        Application server perspective

From the J2EE application server perspective, the JDO implementation is transparent to the user. It is closely related to other technologies, such as J2EE Connector Architecture, which provides transaction, security and connection management features. The JDO implementation uses either a native or third-party resource adapter to connect to the underlying data store where objects are persisted. In addition, the JDO implementation uses the naming-related services of the application server to bind PersistenceManagerFactory instances, which are used by the application to get a PersistenceManager.

¡        Application perspective

This perspective is also valid in a non-managed environment. A JDO-aware application provides classes that implement the javax.jdo.PersistenceCapable interface. The instances of these classes represent the objects stored persistently in the datastore. The persistent instances are managed by a PersistenceManager – an instance of the javax.jdo.PersistenceManager interface. Using the JDO API and particularly the PersistenceManager interface, the applications gain access to the JDO implementation in the application server. In addition, they have a reference to a StateManager that manages the field values and the lifecycle of the managed persistent instances.

Each PersistenceManager keeps a cache of persistent instances, which reduces the number of datastore accesses, thus improving the JDO performance. Multiple PersistenceManagers may use the same datastore instances represented by different persistent instances. Furthermore, PersistenceManagers from different JDO implementations can work with instances of the same persistence capable class because of the high portability of the JDO-based applications.

The SAP JDO implementation is a part of the J2EE Engine – that is, it is a part of a managed environment. Your applications can transparently store objects in a persistent store, namely a relational database. The JDO support in the J2EE Engine is provided by implementing the interfaces from the javax.jdo package, while also extending some of them to add functionality. In addition, SAP provides a proprietary resource adapter developed in according to the J2EE Connector Architecture standard that enables the connectivity to the data store using JDBC. The Transaction Service and the Connector Container Service in the J2EE Engine provide the transaction and resource management functions.

To use the JDO implementation, the J2EE applications deployed on the server look up a preconfigured PMF from the naming system, and use it to obtain a PM instance. The PM is the interface for working with the JDO instances. It is a connection handle that represents a database connection to the application.

The SAP JDO implementation enables you to use object-oriented persistence in various programming models with Web and enterprise beans components. For more information, see JDO Programming Models.

 

See also:

Supported Options in the SAP JDO Implementation

The Default PersistenceManagerFactory

End of Content Area