Oracle TopLink Developer's Guide
10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
For non-J2EE applications, you typically use internal connection pools provided by TopLink (see "Internal Connection Pools"). In this case, you can use TopLink Workbench to configure connection pool options and to create a sequence connection pool and application-specific (named) connection pools.
For J2EE applications, you typically use external connection pools provided by a JDBC driver or J2EE container (see "External Connection Pools"). When you configure a session to use external connection pooling, by default, TopLink performs all data source read and write operations (including reads and writes used to obtain object identity information for sequencing) using connections supplied by an application server or container. In this case, you must use Java to configure connection pool options and to create additional application-specific (named) connection pools. Optionally, you can configure a read connection pool to use a nontransactional login, and you can configure a sequence connection pool to use a separate (preferably nontransactional) login of its own.
Because JTA external transaction controllers are dependent upon the external transaction service that the application server provides, you must configure TopLink to use external connection pools if you are using an external transaction controller (see "Integrating the Unit of Work With an External Transaction Service").
External connection pools enable your TopLink application to do the following:
Integrate into a J2EE-enabled system.
Integrate with JTA transactions (JTA transactions require a JTA-enabled data source).
Leverage a shared connection pool in which multiple applications use the same data source.
Use a data source configured and managed directly on the server.
Without JTA, external connection pools generally offer benefits only if transactions in a TopLink application are independent of each other and any other transactions in the system. In that case, the complexities of a TopLink connection or connection pool are unnecessary.
For more information about connection pools, see "Connection Pools".
To specify if the session login uses external connection pooling, use this procedure:
Configure a data source on the application server.
If you are using the external connection pool with an external transaction controller (see "Configuring the Server Platform"), be sure to configure a JTA-enabled data source.
For more information, see your J2EE container documentation.
Select a server or database session in the Navigator. Its properties appear in the Editor.
Click the Login tab. The Login tab appears.
Click the Connection subtab. The Connection subtab appears.
Figure 85-1 Login Tab, Connection Subtab, External Connection Pooling Field, Database Driver
Figure 85-2 Connection Tab, External Connection Pooling Field, J2EE Data Source
Specify if this login uses External Connection Pooling. For a database driver, external connection pooling is optional. For a J2EE data source, external connection pooling is mandatory.