[Top] [Prev] [Next] [Bottom] [Contents]

Stand-alone Server Applications

The Sapphire/Web application always requires a Gateway Daemon in order to have database access. The Server Applications, however, can be independent of the Sapphire/Gateway mechanism by talking directly to a single database vendor's server. Doing this has several implications.

1. Client applications must link in the RDBMS vendor's libraries.

2. Only one RDBMS vendor can be accessed with a stand-alone Server Application.

3. Server Application executables must configure environments for RDBMS connectivity.
The advantages to using non-ORB clients are:

1. An increase in database access speed.
2. Configuring an ORB and client to ORB connection is not necessary.

The sachmake.sh Utility

If you choose to make your Server Applications stand-alone, there are a few steps to follow:

1. Design and test your Server Application application.

2. Save the application. Code is generated at this time.

3. Run the following shell script which will convert your Gateway-dependent Makefile to a stand-alone Makefile:
$SAPPHIRE/bin/sachmake.sh makefile switch_flag
Where:
makefile
is the name of your generated makefile (projectname.mak).
switch_flag
is SYBASE, ORACLE, INFORMIX or ORB
4. Run the following make command:
     make -f makefile
Be careful not to overwrite your makefile when generating code again from within Sapphire/Web. If you do overwrite your makefile, you can rerun the sachmake.sh script again.

The sachmake.sh utility allows a client Makefile to be converted from its present state to either SYBASE, ORACLE, INFORMIX or ORB. If you run the utility once and convert to ORACLE, you can run it again on the ORACLE makefile and change it to SYBASE.

Use the ORB option to convert a makefile back to using the Sapphire/Gateway.

There may be problems while linking your clients with your RDBMS vendor's libraries. We have used a generic configuration of libraries in our makefile for linking to RDBMS vendor libraries, but they vary for different configurations.

Check the sachmake.sh script for different variations of link lines per vendor/platform configuration.

Sybase is generally very simple because there is one library.

Oracle and Informix use several libraries each, and some libraries are used more than once on the link line. By uncommenting certain options and commenting the old options, you can try different configurations that might work for your setup.

The actual Sapphire/Web application must always use a Gateway Daemon.

Configuring Your Server Application to be Stand-alone

In order to make a Server Application ready to run stand-alone, there are some steps that need to be taken. Linking the Server Application (described above) is the first step. The Web Server and/or the Server Application code itself may also need to be configured.

Method 1

The first method is to hard code the database environment into your Server Application so it can connect to the database when it gets called by the Server Application server. This can be accomplished by adding the following to the /* main function Initial Code */ section of the Project Code Editor in your project (Choose only the database environments that apply to your application):

putenv("SYBASE=sybase_root");
putenv("ORACLE_SID=connection_string");
putenv("INFORMIXDIR=informix_root");
putenv("INFORMIXSERVER=default_server");
Note: This last line is not always needed.

Method 2

If your Web Server can be configured so that it runs Server Applications with a settable environment, you can configure it to call your Server Applications with the appropriate environment. Use the databases you need from the following environment setup (Choose only the database environments that apply to your application:

C Shell Bourne/Korn Shell
setenv SYBASE sybase_root SYBASE=sybase_root
setenv ORACLE_SID connection_string ORACLE_SID=connection_string
setenv INFORMIXDIR 
informix_root
INFORMIXDIR=informix_root
setenv INFORMIXSERVER default_server INFORMIXSERVER=default_server
export SYBASE ORACLE_SID INFORMIXDIR INFORMIXSERVER

The INFORMIXSERVER line is not always necessary.



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.