Previous versions of TDI configured the System Store using Cloudscape by means of a set of properties in the global.properties file, and version 7.0, now using Derby, still derives its base configuration from there. You should migrate any non-standard installations of Cloudscape configuration to the methods described in the previous chapter, Configuring Derby Instances.
In the global.properties file in the installation directory, there are two sections that are concerned with the configuration of the System Store:
Note that the section with configuration parameters for embedded mode specifies a relative path for the Derby database; this typically means the database is created in the Solutions directory. The set of parameters for Networked mode uses an absolute path: it points to the installation directory. If you switch between the different modes be aware of this, and possibly change the path to an appropriate value, for the mode you intend to use.
Best practice is to keep databases, keystores and all other user data out of the program installation directory.
When deploying networked or shared mode, startup of the Derby database thread is automatic; however, shutdown is not. You should shut down the instance when you are finished with your last AssemblyLine.
Cloudscape command-line utility
To make working with the Derby database more convenient, consider creating a script ("dbserver") with the following line (this example is for Unix/Linux):
export DB_JAR_DIR=jars/3rdparty/IBM export DB_CLASSPATH=$DB_JAR_DIR/derby.jar:$DB_JAR_DIR/derbyclient.jar:\ $DB_JAR_DIR/derbynet.jar:$DB_JAR_DIR/derbytools.jar java -classpath $DB_CLASSPATH org.apache.derby.drda.NetworkServerControl "$@"
You may have to join the middle two lines together at the "\" point.
The equivalent dbserver.bat file for Windows would be:
set DB_JAR_DIR=jars/3rdparty/IBM set DB_CLASSPATH=%DB_JAR_DIR%\derby.jar;%DB_JAR_DIR%\derbyclient.jar;\ %DB_JAR_DIR%\derbynet.jar;%DB_JAR_DIR%\derbytools.jar; java -classpath %DB_CLASSPATH% org.apache.derby.drda.NetworkServerControl %*
The script must be started from within the IBM TDI installation path as the working directory, as the following classpath is relative to this directory.
The following is an example of usage of this utility script:
Show all available commands: ./dbserver Start DBServer ./dbserver start -p 1527 Stop DBServer ./dbserver shutdown
The full list of sub-commands that we can specify to the dbserver script, and which are sent to Derby is:
When running in networked mode, the Derby database is of course reachable over the network, not only by IBM TDI instances but also by other applications using the appropriate drivers. The credentials required for such access are defined in the global.properties file, and might have to be tailored for your particular site needs. Pay particular attention to the username and password parameters as these govern integrity and security of the data.
If you often alternate between running Derby in dedicated mode and in networked mode, consider having two different "prototype" global.properties files on the file system, one each with the correct set of parameters for each of the two modes. Just before starting a server instance, copy in place the appropriate global.properties file, according to our needs. Alternatively, use separate Solution Directories; in a Solution Directory we can have a file called solution.properties, which property values defined in there override the ones defined system-wide in global.properties.
The official Derby home at http://db.apache.org/derby, documentation at http://db.apache.org/derby/manuals/index.html.
For further information on the command options and the specification on each command, see http://db.apache.org/derby/docs/10.0/publishedapi/org/apache/derby/drda/NetworkServerControl.html.