Oracle® Application Server TopLink Application Developer's Guide
10g Release 2 (10.1.2)
Part No. B15901-01
In OracleAS TopLink applications, data access offers the functionality and features that enable you to manipulate data on a database and map a data source with the OracleAS TopLink Software Development Kit (SDK).
This section introduces some of the key concepts associated with OracleAS TopLink data access features.
Java Database Connectivity (JDBC) is an application programming interface (API) that gives Java applications access to a database. OracleAS TopLink applications rely on JDBC connections to read objects from, and write objects to, the database.
OracleAS TopLink applications use either individual JDBC connections or a JDBC connection pool, depending on the application architecture.
An individual JDBC connection gives a single user access to the database for a single session. For example, a two-tier OracleAS TopLink architecture usually connects to the database using a database session and a single JDBC connection. OracleAS TopLink invokes the JDBC connection as part of the login for the database session in the
For more information about sessions, see Chapter 4, "Sessions".
A JDBC connection pool is a collection of JDBC connections managed as a group. Most three-tier multiuser applications use connection pools.
JDBC connection pools enable you to configure connections for several users using less than a one-to-one ratio of connections to users, because the connections in the pool are reusable. For example, a two-tier application requires one JDBC connection for its one user. A three-tier application, conversely, can support several thousand users with a connection pool of only a few connections, depending on the application. The connection pool assigns connections to clients, retrieves the connections when clients complete their tasks, and reuses them for future database requests. The connection pool also queues database requests when requests outnumber the available connections.
OracleAS TopLink supports two types of connection pools: the default OracleAS TopLink internal connection pool and external connection pools.
Because of the multiuser nature of a server session, OracleAS TopLink establishes a connection pool for all server sessions by default. The pool includes several database connections that can be configured, and OracleAS TopLink manages the pool automatically.
The JTA is a specification that enables your application to participate in a distributed transaction system. The system provides transaction management and connection pooling and enables your application to interact with multiple databases transparently.
OracleAS TopLink applications that use an application server often use JTA to manage database transactions.
OracleAS TopLink applications store object attributes on a database. To enable this functionality, OracleAS TopLink must convert object attributes, which are Java types such as
INTEGER, to database types, such as
NUMERIC. The OracleAS TopLink conversion manager manages these conversions and enables you to build custom conversion classes.