Optimizing the connection strategy for Java Toolbox for I

Source: Internet
Author: User
Tags connection pooling

As an object-oriented Java programming model, IBM Java Toolbox for I provides API-level communication support for Java applications to access IBM I data and resources. While the AS400 class represents the IBM Java Toolbox for I socket connection with IBM I, any behavior that relies on IBM Java Toolbox for I to manipulate IBM I data and resources is premised on communication with IBM I. In this sense, AS400 can be viewed as an access point for IBM i. The main objective of this article is to instruct readers how to use IBM Java Toolbox for I to optimize the connection with IBM I from the perspective of reusing IBM I connection object AS400. For a basic knowledge of IBM Java Toolbox for I, see another technical document "Toolbox for Java and Jtopen."

From the content, this article mainly divides into 5 parts. The 1th part mainly from the connection pool optimization angle, introduced IBM Java Toolbox for I to the IBM I Connection optimization, the 2nd part mainly from the reuse AS400 object's angle, introduced IBM Java Toolbox for I's optimization strategy The 3rd part is the combination of two optimization strategies of connection pooling and reuse AS400, and the 4th part is about optimizing the start and stop strategy of IBM I Connection; the 5th part is summary.

IBM Java Toolbox Connection Pooling optimization

In general, a habitual idea for optimizing communication connections is to use a connection pooling strategy to reduce the resource and time overhead associated with each server-side connection. IBM Java Toolbox For I provides a as400connectionpool class for creating and managing connection pooling, as shown in Figure I.

Figure 1. Working principle of connection pool

The As400connectionpool class works as follows:

Create IBM I connection pool object-as400connectionpool.

Set connection pool-related properties, such as the maximum number of connections.

Establish a certain number of pre-connections, known as idle connections.

For a server access request, a connection is obtained directly from the connection pool. If there are no idle connections in the connection pool object and the number of connections does not reach the maximum active connections, a new IBM I connection is created.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.