Previous Next Contents Index


Chapter 5 Databases

Netscape Application Server: Process Automation Edition (PAE) stores user data in a relational database. The database provides a centrally available repository for user data for each application in a cluster, plus a common set of tables that all applications can share. In addition, there are adapters for each type of database that handle mapping between PAE types and the data types used by each kind of database, so process designers can design process definitions that are database independent.

This chapter discusses these topics:

Note
This chapter only provides general guidelines for using databases with PAE. For specific situations and error conditions, consult your database administrator (DBA). For example, if you encounter a Sybase log full error, you should refer the problem to your database administrator for a solution.


Overview
Netscape Process Manager uses an Oracle or Sybase database to store process instance data, so you must have a database available to you on your local system or available over a network on another system. If you are using a remote database, you must have the appropriate database client installed on your local system. You need to have enough privileges to create tables, write to tables, and to create views.

Process Manager supports the following databases:

There are several ways a PAE end user and administrator interact with database tables. Sometimes they need read-only access, but sometimes they add new data or update existing data. Note that the database access is transparent to the end user or administrator. They are only aware that they are viewing, adding, or modifying process instance data.

End users are accessing a database when they perform these operations:

Administrators are accessing a database when they perform these operations:

At each database operation, PAE collects data into implicit database transactions to protect application data in the database. Transaction-based processing allows rollbacks and automatic database cleanup if any PAE operation fails.

Note
Each of these transactions generates an entry in the database transaction log, so make sure you have plenty of space available for the log. If you are using a Sybase database, it disconnects automatically when there is not enough space for additional transaction log entries. You can increase the transaction log size for your Sybase database to help avoid this problem.


Using Databases With PAE
To provide consistency across all applications in a cluster, all applications share a single relational database.

This section includes these topics:

Cross-Application Tables
The database has five common, cross-application tables that are shared across all applications and one application-specific table for each application (this value is used in the DB Application Table field in the application's definition in Process Builder). The cross-application tables contain standard data for each process instance and work item, while the application-specific tables contain the user data that is unique to each application.

The cross-application tables are:

Table 5.1 The database tables
process_instance
work_item
history
wf_blobs
wf_instance_id
wf_instance_id
wf_instance_id
wf_instance_id
wf_creation_date
wf_fork_id
wf_fork_id
wf_field_cn
wf_creator_dn
wf_node_cn
wf_event_id
wf_blob_content
wf_title
wf_wi_state
wf_event_type

wf_priority
wf_expired_flag
wf_event_date

wf_entry_cn
wf_wi_cdate
wf_wi_cdate

wf_exit_cn
wf_exp_date
wf_wi_exp_date

wf_last_modified
wf_user_dn
wf_user_dn

wf_pi_state
wf_target_cn
wf_app_cn

wf_app_cn
wf_performer_url
wf_comment

wf_observer_url



wf_performer_url



wf_archived_flag



Note
In a Sybase database, the maximum number of bytes per row is 1962. If you create tables with varchar, nvarchar, or varbinary columns whose total defined width is greater than 1962 bytes, a warning message appears, but the table is created.

Primary & Foreign Keys
The database tables are set up to share the process instance, wf_instance_id, as a key. The process_instance table uses the wf_instance_id field as the primary key. The wf_instance_id field in other tables is considered as a foreign key. The work_item table uses a concatenated key of wf_instance_id, wf_fork_id, and wf_node_cn to precisely identify a work item in a parallel processing application, where there may be several work items for a specific process instance.

Database Views
To allow simplified queries, PAE provides some standard views into the database information. These offer a predefined subset of the data available in the database.

PAE constructs these views:

Database Users
There are three kinds of database users:

Database Adapters
Each type of database supported by PAE has its own adapter. After the database type is determined, the adapter handles storing data in the database and takes care of such database-specific characteristics as type mapping.

Because type mapping in PAE is handled by the database adapters, Process Builder designers can use a single set of types that can be correctly interpreted for each type of database. Designers do not need to concern themselves about how their data types are stored in a given database.

Note
Designers who write their own customized scripts cannot use certain transaction control statements in their scripts such as begin, commit, and abort. In addition, if they are using an Oracle database, they cannot use DDL in their script statements. Also, Process Builder does not check for all reserved words for every database. If a custom script contains a reserved word, your application deployment may fail.


Storing Digital Signatures
PAE has a special database table for storing digital signatures, wf_blobs.

Table 5.2 Fields in the wf_blobs database table
wf_blobs
wf_instance_id
wf_field_cn
wf_blob_content

You can perform dbadmin queries against this table to verify digital signatures as required. For example, you could execute this query

SELECT * from wf_blobs WHERE wf_instance_id = <ID> and wf-field_cn = '<sig-field>'

to obtain the user ID, user name, and digital signature for a specific process instance. Note that to do this, you will need the process instance ID.


Setting Up Your Database
PAE requires the use of an Oracle or Sybase database. You can use whatever database you already have installed, or you can install a new database for your PAE data. You, or the database user you identify, must have create and write permissions for tables and views.

Note that if you are using Sybase, a database already exists for PAE's use. The database administrator of your enterprise should have created this database before creating a cluster. The database administrator must make sure the PAE administrative user has create table/create view privileges on that database. Sybase databases are no longer created during cluster creation.

Information you need to know before you attempt to create a new cluster or to join an existing cluster are:

See the Installation Guide and the Netscape Application Server Administration Guide for more information about setting up your database. You can locate Netscape Application Server documentation in the following location: serverRoot/nas/docs/index.htm

Database Connections
Database connections are maintained through Netscape Application Server. You can set connection parameters in Netscape Application Server (NAS) Administrator.

To set the connection parameters, perform the following steps:

  1. From Netscape Console or the Windows NT Start menu, launch NAS Administrator.
  2. On the NAS Administrator toolbar, click the Database button to open the Database window.
  3. In the left pane of the Database window, click the database for which you want to adjust the timeout parameter.
  4. In the right pane of the Database window, in the Connection Timeout field, enter the number of seconds.
You can also set the minimum and maximum number of threads available for database connections. The thread parameters determine how many threads NAS allocates for asynchronous database queries. Such threads are usually used for queries returning a large number of rows and allowing the application to do other tasks while waiting for the query to finish. Asynchronous database queries are not supported by JDBC 2.0, a Java programming interface used to build on top on database drivers.

The default thread allocations are adequate for most applications. If an application developer uses many asynchronous queries, you might want to increase the maximum number of available threads. Keep in mind that each thread does use a small stack allocation and pulls from the total number of available system threads. Therefore, if an application does not use any asynchronous queries, you can increase performance by setting the maximum available threads to zero.

To set the thread parameters, perform the following steps:

  1. In the right pane of the Database window, in the Minimum Threads field, enter the number of threads.
  2. In the right pane of the Database window, in the Maximum Threads field, enter the number of threads.
The database cache is an array used to hold active and recently used database connections. NAS adds database connections to cache when an application creates a database connection.

While the application is using that database connection, NAS marks that connection "in use." Once the database operations are finished, the server marks the database connection "free." The cache then holds the free connection in the cache for a configured period of time. This allows the server to use the free cached connection and quickly handle a new request to the same database. Once a free connection exceeds the timeout, a cleaning thread removes the connection from the cache and opens a slot for a new connection to be cached.

You can adjust the following cache parameters:

The default values are adequate for most applications, so adjustments are not usually required for initial application installations.

NAS dynamically adjusts the cache up to the maximum number of allowable connections. If there are no connections to cache, the array is allocated to zero spaces.

  1. In the right pane of the Database window, under Cache, enter values for the following parameters:
  2. Click Apply Settings to save the changes to NAS.
It is perhaps worth noting here that Process Express, Process Administrator, and Process Business Manager also each use a database connection. Whenever you are tracking the number of connections in use at a given time, remember that two connections are always taken by these components.

 

Copyright © 1999 Netscape Communications Corp. All rights reserved.