[an error occurred while processing this directive]
> developer > web app development
Automated Initialization of 3270/5250 Connection Pools
by exteNd Composer Product Team, eBusiness Integration Products, Novell
Date Created: 2001-12-18 15:21:00.000
  Introduction
  Getting Started
  Conclusion
introduction

eXtend Composer provides a 3270/5250 console that allows you to pre-load connection pools with the press of a button.  Pre-loaded connections improve performance by making all connections  ready to use  before a Composer service begins execution.  This article will explain how you can pre-load connection pools without user intervention by use of a servlet.  Two versions of the servlet will be included:  a version for the SilverStream application server (using the server event business object) that allows the pools to be loaded upon server startup as well as on a schedule (using the SSSW scheduled business object).  The second version of the servlet is a generic servlet that can be used with non-SilverStream application servers.

getting started

 As part of the eXtend Composer 3270/5250 Connect, the 3270/5250 Server Console(s) gives the user the ability to not only manage the 3270 Pool connections, but also pre-initialize the pool.  In a production environment, the ability to pre-initialize the connection pool provides a convenient method of enhancing the performance of the application for the initial users.  The administration capabilities for the connection pool allow you to Reset, Refill, and/or restore the discarded connections in the pool once the connection pool has been established.   

Although this functionality provides flexibility and reduced overhead on initial user requests, there is one drawback.  The user must access the 3270/5250 Server Console and perform these operations manually.  The servlets included with this article are designed to give the user the capability of scheduling an automated service that will run at predefined times (via a scheduled business object) as well as at server startup (via a server event business object).  The benefit of this is that it provides a call to both the Reset Discarded and the pre-initialize methods on a scheduled basis for the lifetime of the server.  In a mainframe environment, sometimes the systems are shut down or taken offline after-hours for regular scheduled maintenance and are brought back up at a scheduled time. 

These servlets will allow the Composer services to mimic this behavior by re-initializing the connection pool at a predefined, scheduled time as well as remove and/or reset any discarded connections in the pool at the time of execution.  The pre-initialize method can execute both before and after a connection pool is established. Therefore if a certain number of users were logged into the system previously, the connections will not be reset: only the remaining number of available connections will be established.  The Reset Discarded method will execute only when a connection pool is established. Otherwise the command will be ignored.

The following table lists the Java files required to implement the servlets (http://ftp1.novell.com/pub/dev_articles/InitConnectionPool.zip ), along with a brief description of each. Any required user modifications to these files are displayed in Italics. Once the necessary changes are made, the files need to be compiled in the application server. (See your application server documentation on how to perform this task.)  Also, on the SilverStream application server, the project jar file that contains the deployed eXtend Composer Web Services as well as the connection resources must be associated with the Scheduled Service Trigger object.  This is done in the SilverStream Business Object Designer.

File

Description

TN3270.java

Servlet for the SilverStream Application server which contains two triggers: scheduled and startup server event.  You will need to associate the deployed eXtend Composer project .jar file with this servlet. The servlet is designed to respond to AgoScheduledEvent and AgoServerStartEvent event types.

PoolInit3270.java

Source class to access the 3270/5250 connection pool object.

GenericTN3270Servlet.java

Servlet for the Websphere or Weblogic Application servers.  See the appropriate user guide to install and configure this servlet.

 TN3270.Java And GenericTN3270Servlet.java requires two changes:

Variable

Change to

CONNECTION_NAME

the name of the connection that your 3270/5250 Logon component uses

FULLY_QUALIFIED_CONNECTION_NAME

a concatenation of the following:

a)     the deployment context in the project jar

b)     a slash ("/") + the text "connection"

c)      the CONNECTION_NAME as described above. See source code for an example.

conclusion

Preloading 3270 or 5250 connection pools can boost performance, because the logon component processing has already executed and the user doesn't need to wait for this to finish.  Pre-loading connection pools can be performed through the 3270/5250 console by pressing a button, but when this is inconvenient or impractical, the process can be automated through the methods described above.

Note:  you must unzip your deployed jar into the extendComposer\lib directory for the initialization of connection pools to work as described above.