IBM is enabling certain Express client functionssuch as OLE DB, automation objects, and C/C++ APIsas the middle tier in a three-tier client/server environment. Heres how Express client can function as a monkey in the middle for products such as Microsofts Internet Information Server (IIS) and the Terminal Server Edition of Windows NT 4.0. If youre looking for a way to leverage Express client over a network or the Internet (without installing the product on user desktops), this article is for you.
Although most people consider Client Access to be a set of client applications and APIs, a quiet evolution has been occurring over the last few releases of Client Access for Windows 95/NT. Beginning with V3R1M3 of the Windows 95/NT client, Client Access has supported the use of ODBC running as a service on a Windows NT 4.0 server. This step was merely the first in enabling Client Access as middle-tier software for your three- tier client/server network. With its new 32-bit Windows client, AS/400 Client Access Express for Windows (Express client), IBM is changing the way you network, allowing your network users (and even your Internet users) to take advantage of Express clients functionality without having to load the product on their computers.
When IBM designed Express client, one of its design goals was to provide multiuser and three-tier environment support for network users. Redesigning Express clients core processes allowed more parts of the program to run as NT services, enabling multiple users with different communications characteristics to run a single copy of Express client on the same machine.
In this article, we discuss how to use Express client in a three-tier environment and how your shop can benefit from this exciting new feature. We provide an overview of how Express client functions in the three-tier environment and how to use it as a service for importing data via Express client into Web pages using Microsofts Internet Information Server (IIS). We also detail how to use it in a thin-client environment that uses Microsofts Transaction Server (MTS) and Windows NT 4.0 Terminal Server Edition. Youll see that Express client is more than a single-user solution and that IBMs new product can function as a sort of monkey in the middle by delivering Express client services to networked clients. (Also, be sure to check out the references at the end of the article for more detailed information on how to deploy these techniques in your environment).
Express Client in a Three-tier Environment
Before exploring how to use Express client in a three-tier environment, you need some basic definitions, particularly those outlining what a three-tier application encompasses. All three-tier applications consist of the following layers:
Presentation layer (client tier). This layer presents the user interface for displaying and manipulating data. It may be a Web browser running on an IBM Network Station or a custom-built application that uses a remote component. Express client is not used in the client tier.
Business logic (middle tier). This layer contains the application logic. For the purposes of this article, the middle tier consists of a remote component or a Microsoft Active Server Pages (ASP) script running on a Windows NT 4.0 server. You install Express client on your Windows NT 4.0 server, and then remote or network users can access AS/400 services.
Services (database tier). This layer typically is data stored in DB2/400. You can access other AS/400 services through various host server programs or through a custom- built AS/400 program.
The key to three-tier development is that each layer is independent of the other, allowing each layer to be isolated and run on a different computer. This article concentrates on using Client Access in the middle tier.
The Microsoft technologies found in the middle tier include the MTS and the IIS. IIS includes an ASP development environment that allows the execution of scripts and ActiveX components on the server. OLE DB, ActiveX Data Objects (ADO), and Remote Data Service (RDS) are the technologies Microsoft currently recommends for accessing data from a middle-tier component. Figure 1 shows where Client Access fits into an IIS environment with ASP and ADO. Refer to the references listed at the end of the article for further information on Microsoft three-tier technologies.
Express Client Three-tier Techniques
Express client provides a variety of technologies that allow a Windows NT middle- tier component to fully access the power of the AS/400, including the following:
Express OLE DB provider
Express ODBC driver
ActiveX automation objects
Express C/C++ APIs With Express client, the AS/400 OLE DB provider now supports four different DB2/400 access methods in a three-tier environment:
Record-level access
SQL and stored procedures
Remote commands and distributed program calls
Data queues Most applications and components access the Express client OLE DB provider indirectly through ADO. The use of ADO and Express client OLE DB provides a simple, consistent interface to AS/400 services regardless of how the data is stored. You can use the same programming techniques, with only a few minor changes, to access AS/400 programs, data queues, commands, SQL queries, stored procedures, and physical and logical files. ADO and OLE DB also provide automatic data conversions between the AS/400 and PC data types. Support for record-level file access allows for more efficient data access when you dont need the full power (and overhead) of SQL. The AS/400 OLE DB provider also offers what is perhaps the easiest technology for building three-tier applications. Figure 2 shows how the Express client OLE DB provider interfaces to the AS/400.
In addition, you can access the Express client ODBC driver through ADO by using the Microsoft OLE DB provider for ODBC (MSDASQL). Also, you can use the Express ODBC driver with RDS because RDS accesses data through MSDASQL. The Express
client ODBC driver provides enhanced SQL functionality compared to the Express client OLE DB provider. If you need functions such as updateable cursors, SQL commitment control, or stored procedure multiple result sets, then use the ODBC driver rather than the OLE DB provider. The other primary advantage of using ADO/ODBC over the native OLE DB provider is that ODBC allows connection pooling. In a typical MTS or ASP application, each client request generates a connect/disconnect to the AS/400. The overhead associated with the AS/400 job startup often is more than that of the actual request. ODBC connection pooling solves this problem by managing a pool of persistent connections, which provides a significant performance advantage over any other access method discussed in this article. Be aware, however, that at the time this article was written, testing of ODBC connection pooling had just begun. Official support for connection pooling in Express client will not be announced until after this testing has been completed.
Express client also includes a library of new, enhanced ActiveX automation objects. These objects provide access to AS/400 data queues, remote commands and distributed program calls, administration objects, and AS/400 system objects. You can use all of these objects in middle-tier development. Note that the original Windows 95/NT client automation library is still included with Express client. The original automation objects, including the database automation objects, were not revised and should not be used in a three-tier environment.
Automation Objects, ADO, or C/C++ APIs?
Is it better to use the automation objects or ADO? That depends. The first thing to consider is the object model. Visual Basic developers may be more familiar with the ADO object model, but experienced Client Access API developers may prefer the Express client object model. As discussed previously, the ADO object model imposes a consistent view of the data however that data is stored. This feature is ADOs greatest strength, but also its greatest limitation. The one size fits all object model does not allow applications to fully tap the power of AS/400 services. In contrast, the Express client object model provides some functions not available with ADO, such as enhanced data queue function and enhanced parameter passing for AS/400 programs. In general, automation objects offer more functionality and greater flexibility at the expense of a few more lines of code.
You can use the Client Access C/C++ APIs in a three-tier environment as well. Typically, you use these APIs in custom-built business components written in C or C++. The Client Access APIs provide fast, low-level access to AS/400 host servers, but using them in a three-tier environment has several disadvantages. Programmers must have experience working with C APIs and data types, and programmers also need to account for thread-safety issues when creating their components. Only experienced C/C++ developers should use these APIs.
Express Client Middle-tier Development Guidelines
When developing Express client middle-tier components, you need to follow a few guidelines. First, middle-tier components cannot have a user interface. To prevent Express client from displaying AS/400 sign-on information, three-tier developers must properly use a new AS/400 system object. The AS/400 system object allows a user to specify all the information required to connect to a specific AS/400. It also has a new property, PromptMode, that allows programmers to specify how sign-on requests should be handled. This property must be set to cwbcoPromptNever or the three-tier application may appear to hang. OLE DB and ODBC do not allow direct access to the system object. However, both API sets include APIs that provide similar function.
Three-tier Express client testing has focused on using Express client and ASP scripts. No specific testing has been done yet with Express client and MTS. The same Express client technologies discussed for use with IIS should also work in MTS components, but remember that MTS components that use Express client functions must have their transaction property set to Does not support transactions.
Client Access in a Multiuser Environment
Another environment that puts Express client in the middle is the use of Microsofts Windows NT 4.0 Terminal Server Edition (TSE). TSE is a multiuser version of Windows NT 4.0 that allows multiple, simultaneous client sessions to be run on a single NT 4.0 server. One of the advantages of this platform is that the end users dont need to be on PCs or even use a Windows operating system. TSE supports the connection of network stations, UNIX, Macintosh, DOS, OS/2, and other types of workstations. This support allows Express client functionality to be available to more users. Express client is installed only on the TSE, but all attached users can use Express client functions as if they were installed on their local workstations. Figure 3 shows the difference between using Express client on an NT server for multiuser use as opposed to three-tier use.
Before deciding if TSE is the right direction for your company, you need to consider the associated costs. If the client workstations are PCs running Windows 95, 98, or NT 4.0, then you need a TSE license on the server and a Client Access license and Windows desktop license per client. However, if you are using something else, such as network stations, then you have to purchase additional licenses for Citrix MetaFrame. This can add significant costs to your installations, depending on the number of users. If the client workstation is using an X-Windows-based (X.11) protocol, you also need a different software package called WinCenter for MetaFrame, which is available from Network Computing Devices (NCD).
Express Client Licensing
Regarding multiuser use, people usually ask about Express client licensing. Express client is sold based on the concurrent number of users communicating to the AS/400 simultaneously. For example, if you have 50 users but only 25 users might access an AS/400 at the same time, then you need to purchase only 25 licenses. This same principle applies when using three-tier environments. You need a Client Access license for each user who may simultaneously be accessing the same AS/400.
Also, be aware that the Express client ships at no additional charge with OS/400 V4R4, and you can use all Express client functions without a license except for PC5250
and Data Transfer, which require an Express client license for each concurrent user. So, if your users are using only ODBC and OLE DB tasks, they may not need to purchase Client Access Family for Windows (5769-XW1), which may make your Express client DB2/400 access more cost-efficient.
Other Express Client Factors in a Three-tier Environment
Given the new three-tier options available, what other factors should you consider when deciding between a three-tier connection and a direct connection between your Express client machine and the AS/400? Overall, we recommend you look at the following considerations:
What types of workstations are your employees using? Workstation choice is an important consideration. The Express client runs only on 32-bit Windows PCs. If you wish to use IBM Network Stations or do not wish to manage a variety of client software, then a three-tier choice might be right for you.
How critical is performance? If performance is your primary concern, a direct connection from the PC to the AS/400 is usually the best choice. Anytime you introduce a third layer, the network receives increased data flows. But, if your end-user machines are underpowered and you have a middle-tier server loaded with memory and disk (and you dont have too many end users), then a three-tier environment might perform better.
What are your security needs? Security considerations have to do with the number of places you need to sign on from, cache passwords at, and maybe store digital certificates (if you use encryption). Because three-tier applications require no prompting for user IDs and passwords, these items need to be hard-coded or preconfigured into applications running in the middle tier. If you are running Secure Sockets Layer (SSL), look at your digital certificate needs and your needs for transferring them to different workstations in the network.
Where will the critical points of failure be in your network? If continuous uptime is a priority, consider where your critical network failure points are. A gateway PC server is likely to experience more downtime than an AS/400, so, if all of your client-to-server communications flow through a PC server, be aware that this could be your weakest link.
How much do you want to spend? Different networking solutions have different implementation costs, depending on the factors involved. When considering a TSE solution, you may be able to cut workstation costs by purchasing inexpensive network computers, but you need to pay extra licensing fees for the TSE software and for the Citrix MetaFrame software. For other three-tier solutions, in which your end users have Windows PCs, consider the additional cost of purchasing and administering a PC server box, which wouldnt be required with a direct-connected two-tier solution. A three-tier solution enables you to offload processing normally done on a client PC, which can save you money in client hardware needed. But can you save enough to make up the cost of the extra PC server that you have to buy and maintain? That depends on the number of end- user PCs and whether those users need to run other applications that require more processing power, such as Microsoft Excel or Microsoft Access. You may not be saving on the cost of the PCs but actually spending more money on bigger PCs as well as purchasing more PCs to act as gateways.
A Whole New Set of Options
The addition of the Client Access Express for Windows client now gives customers more options in how to access data on their AS/400s. This product is better enabled than previous Client Access clients for three-tier networks, including IIS and TSE environments, so you need to consider a number of different factors in determining how to set up your network. You can run an NT server as your Web server by using the AS/400 primarily as a database, or you can do all of your Web serving on your AS/400 and possibly save some money. You need to look at what your priorities are and make decisions based on those priorities.
Related Reading
A Fast Path to AS/400 Client Server Using AS/400 OLE DB Support, Redbook (SG24-5183), www.redbooks.ibm.com
Citrix MetaFrame Web site: www.citrix.com/products/metaframe.asp Client Access Microsoft NT Server Web site: www.microsoft.com/ ntserver/web Microsoft NT Server Terminal Server Web site: www.microsoft.com/ntserver/terminalserver
Microsoft Windows NT Server 4.0, Terminal Server Edition, IBM APAR# II11373, www.as400.ibm.com/clientaccess/caiixd1.htm
OLE DB Web site: www.as400.ibm.com/clientaccess/oledb Running Client Access ODBC as an NT Service,Client Access/400 Expert, September/October 1998
Web Publishing with the Client Access ODBC Driver and IIS, IBM Technical Studio document, www.as400.ibm.com/clientaccess/iismain.htm
Basic Three-tier Application Using ADO and ASP
Client browser requests an Active Server Page
HTML sent back to the browser during execution of the ASP.
TCP/IP
ASP application level variables
ASP session level variables
CA/400 is used in the middle- tier component to access AS/400 services
AS/400 programs stored procedures and data queues
Active Server Page
ASP Script
Port 3
Figure 1: The basic three-tier application architecture uses ADO and ASP.
ActiveX Custom Business Component CA/400 OLE/DB API ODBC
ActiveX Data Objects Instantiated during the ASP file execution
Middle Tier
Runtime support
IBMDA400
Any OLE-compliant tool (Visual Basic, Delphi, etc.)
ActiveX Data Objects and controls (ADO, ActiveX controls)
OLE DB layer (COM)
Database Program/command Data queues SQL Stored procedures
NETWORK
OS/400 host servers
Command processor DDM/DRDA server
DB2/400
Stored
procedures AS/400 program
Data queues SQL processor
Figure 2: This is how Client Access OLE DB support works.
Multiuser
ODBC Server app
ODBC Server app
Diagram of Multiuser vs. Three-tier
Three-tier
ODBC Server app Network
Station
PC
Network
Station
Network
Station
PC
Network
Station
ODBC Server app
Figure 3: Multiuser support is different than three-tier client support.
LATEST COMMENTS
MC Press Online