Installing the Session Database

The RPM Web Services uses sessions to regulate the exchange of information between the client and the server. A session prompts the client to authenticate, to use the services of the Web Services as long as the server allows, and to logout from the session. The information relative to the session is stored in a database on the client side and on the server side.

The following procedure describes, the session database installation instructions using IBM Cloudscape V10 or its open source version Apache Derby V10. This session database can be used for WebSphere or Tomcat installations. Websphere users can use Cloudscape V5.1, which is included in Websphere 6, however, they will have to adapt installation procedures and datasource parameters.

Installing the session database is the first step required for the installation of the Web Services. It is recommended to reserve 200mb of hard drive space to host the session database.

To install the session database

Note: Paths must be adjusted when operating on UNIX environments.
  1. Download and Install Cloudscape v10.0 from the following link: http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/#N10148. Follow the link in the section: Download IBM Cloudscape version 10.. Alternatively, you can download and install the Apache Derby, open source version of Cloudscape from the following link: http://incubator.apache.org/derby/. Follow the link in the section: Downloads’ and download the most stable Snapshot Jars. The Snapshot Jars include the Derby database tools required to create the RPMSESSION database.
    Note: Do not use the Incubator Release.
  2. Set the environment variable in order to run <ij> from a command prompt. Set derbytools.jar and derby.jar into your classpath. Add to your path the following: %Cloudscape_Install%\frameworks\embedded\bin or %Derby_Install%\frameworks\embedded\bin
  3. Ensure the <ij> command works from the command prompt.
  4. Open a command prompt window.
  5. Move to the root directory c:\ to make it the current directory.
  6. Create an SQL file and name it RPMSESSION.sql with the following SQL command.
    Note: RPMSESSION.sql must be under c:\. RPMSESSION.sql, it must reside in the current directory in order to run it.
    CREATE TABLE RPMSESSION.RPMSESSION
    (
    SESSIONID BIGINT NOT NULL,
    RESOURCEID VARCHAR(32),
    DSN VARCHAR(255),
    ACTIVITY TIMESTAMP,
    PRIMARY KEY(SESSIONID)
    );
    
    CREATE INDEX RPMSESSION_IX1 ON RPMSESSION.RPMSESSION(ACTIVITY);
    CREATE INDEX RPMSESSION_IX2 ON RPMSESSION.RPMSESSION(RESOURCEID);
    
    call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY
    ('derby.connection.requireAuthentication','true');
    call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.user.RPMSESSION','RPMSESSION');
    call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.fullAccessUsers','RPMSESSION');
  7. Type ij then: connect ‘jdbc:derby:c:/RPMSESSION;create=true’;
    Note: The quote (‘) format differs from the DOS shell. Do not paste this command; it must be typed in manually.
  8. Execute the SQL file RPMSESSION.sql by typing the following command: run 'RPMSESSION.sql';
    Note: You can run the above command directly from the ij console.
    Note: The quote (‘) format differs from the DOS shell. Do not paste this command; it must be typed in manually.
  9. Type exit to close ij.
  10. Close the command prompt window.
Note: The Session database can also be installed on Oracle DB or other databases.