Setting up a Transaction Server to Publish a Database
If a PMOD installation has a JDBC database running, it can make the data available for other PMOD installations. To this end a server program - the Transaction Server (TS) - must be started to run in the background and wait for database access requests.
Transaction Server Configuration
The transaction server requires the following configuration items, which are visible on the DB TRANSACTION SERVER sub-pane:
- Port: the IP port on which the server is listening for transaction requests. Note that a port can only be used by a single server process.
- Secure: use encrypted communication. Recommended across public connections.
- Compressed: use compressed data stream. Speeds up communication across a slow connection.
- The database information required in the next section can most easily be completed using the Get from Data Source button. It will list all locale JDBC databases. As soon as one of them is selected, the settings are updated accordingly. See Creation and Configuration of Databases for Details regarding Data Base Connection, Database Path, and File Storage Area Path.
Starting a Transaction Server
The PMOD transaction server is a background process. It can be started in one of the following ways:
- Automatically by user login: If Start DB Transaction Server automatically after user login has been configured in the DB TRANSACTION SERVER configuration page the transaction server is started as soon as a user logs in.
- Manually from the PMOD ToolBox: If automatic starting is not enabled, the user can launch the transaction server explicitly after he as logged in with the button on the ToolBox.
After starting and if the button is activated while the transaction server is running, it displays the transaction server configuration in a dialog window, for example:
Note: When the color of the button changes to blue, a transaction server request is being served. The color changes back after all communications have completed. - By running a command script: A script for starting a Transaction Server is specific for the operating system platform. A start script RunDbSvr with the default configuration is created at installation time in the Start directory. Scripts with a different configuration can easily be generated on the DB Transaction Server configuration pane. As an example, the RunDcmSvr script for Windows and Derby looks as follows:
C:
cd "C:\Pmod3.1"
.\java\jre\bin\java -version
.\java\jre\bin\java -Xmx1200M -jar pmtsvr.jar 5100 JAVA_DB org.apache.derby.jdbc.EmbeddedDriver jdbc:derby:./DATABASES/Pmod ./DBDATA/Pmod/ -d -noLS
A script for mySQL has a different driver specification
C:
cd "C:\Pmod3.1"
.\java\jre\bin\java -version
.\java\jre\bin\java -Xmx1200M -jar pmtsvr.jar 5100 MY_SQL org.gjt.mm.mysql.Driver jdbc:mysql://localhost/Pmod ./DBDATA/Pmod/ -d -noLS
This mySQL script requires that the root user has an empty password. If this is not the case, the user and password must be specified as additional command line arguments:
.\java\jre\bin\java -Xmx1200M -jar pmtsvr.jar 5100 MY_SQL org.gjt.mm.mysql.Driver jdbc:mysql://localhost/Pmod ./DBDATA/Pmod/ -d -noLS
root password
Note: Methods 1 and 2 only allow to publish a single database. Method 3 is not limited in this sense. A script can be run for each database in parallel. In this case, the transaction servers must be started using unique port numbers (eg. 5100, 5101, 5102, ...).
For best performance transaction servers should be run on a machine that is continuously operating and has fast disks. Depending on the network and server performance the speed of the load/save operations may be slower than with local loading/saving. The benefit however is the global availability and centralized maintenance of the data.
CAUTION: Note that the proper interaction between the transaction server and clients requires that all systems run the same PMOD version.