Top
Symfoware Server V12.1.0 Operation Guide
FUJITSU Software

7.2.3 Creating PL/extJava

This section explains how to create PL/extJava.

7.2.3.1 Configuring Database Clusters

Configure the definition of the database cluster.

  1. Configure the "listen_addresses" setting in the postgresql.conf file

    A loopback address is used to connect the Java application to the database. Therefore, ensure that "listen_addresses" is configured to allow connection from localhost.

    See

    Refer to "Connections and Authentication" under "Server Administration" in the PostgreSQL Documentation for details.

  2. Add users who connect to the database

    If Java applications access the database, use the JDBC connection pool.

    Use the CREATE USER statement to add users who connect to the database. Specify the additional user names when creating the container.

    Example

    If the user name is "user01"

    db01=# create user user01;
  3. Configure the pg_hba.conf file

    Establish a local connection to the database from the Java application. Ensure that the settings allow local connections.

    Parameter

    Parameter value

    TYPE

    "host"

    DATABASE

    Name of the database the Java application connects to

    USER

    User name used when the Java application is connected to the database

    ADDRESS

    127.0.0.1/32

    AUTH-METHOD

    Use a method other than trust authentication

    See

    Refer to "The pg_hba.conf File" under "Server Administration" in the PostgreSQL Documentation for details.

  4. Configure "max_connections" in the postgresql.conf file

    Add the number of connections used when connecting from Symfoware Server Java application server to the database, calculated as shown below, to the existing value of max_connections.

    numberOfJavaVmServerInstances x 64

    See

    Refer to "Configuring Remote Connections" in the Installation and Setup Guide for Server for details.

7.2.3.2 Creating Containers

Create one container per database within a database cluster that uses Java functions.

When you create a container, a server instance (Java VM) is created in the container at the same time. Settings for the JDBC connection pool and the data source used to access the database from the Java application are also configured at this time. The name of the server instance (Java VM) will be "databaseName-serialNumber". Confirm the name of the server instance (Java VM) using the list-container subcommand of the pgx_jadmin command.

See

Refer to "pgx_jadmin" in the Reference for information on the list-container subcommand.

  1. Stop the instance

    Refer to "2.1 Starting and Stopping an Instance" for information on how to stop the instance.

    Refer to "8.11 Actions in Response to Failure to Stop an Instance" if the instance fails to stop.

  2. Create the container

    Use the create-container subcommand of the pgx_jadmin command to create the container. Information required for the database connection can still be modified later.

    Example

    > pgx_jadmin create-container --dbname db01 --dbuser user01 --dbpassword password1 --instanceport 26531,26532

    See

    Refer to "pgx_jadmin" in the Reference for information on the create-container subcommand.

  3. Add the server instances (Java VM)

    To simultaneously execute 65 or more Java applications, add the required extra number of server instances (Java VM).

    Refer to "7.3.3.1 Adding or Deleting Server Instances (Java VM)" for information on adding server instances (Java VM).

  4. Start the instance again

    Refer to "2.1 Starting and Stopping an Instance" for information on how to start the instance.

    Refer to "8.10 Actions in Response to Instance Startup Failure" if the instance fails to start.

  5. Install the PL/extJava extension

    Execute the CREATE EXTENSION statement and install the PL/extJava extension.

    db01=# CREATE EXTENSION plextjavau;