Transactd Utilities guide

This document consists of the how to use the utilities.

Installation, please refer to the installation of Transactd Utilities.

Index

Transactd High Availability (THA) manager

How to use Transactd High Availability (THA), please see haMgr reference (Japanese). For Details of how THA works, please see High Availability (THA) (Japanese).

Details of the benchmark program

There are two types in the benchmark program. One of them is the benchmark which read SQL-like query (bench_query_xxx). Another is basic CRUD operations benchmark (bench_tdclcpp_c_xxx).

bench_tdclcpp_xxx can be executed in multiple instances, by changing the processNumber in command line arguments.

The command line options are:

bench_tdclcpp_c_xxx.exe databaseUri processNumber functionNumber

|----------------|--------------------------------------------------------|
| option name    | description                                            |
|----------------|--------------------------------------------------------|
| databaseUri    | URI of a database.                                     |
|----------------|--------------------------------------------------------|
| processNumber  | Specify different number to run two or more instances. |
|----------------|--------------------------------------------------------|
| functionNumber | Specify the operation number.                          |
|                | The operations:                                        |
|                | -1: all of following                                   |
|                |  0: Insert                                             |
|                |  1: Insert in transaction. 20rec x 1000times           |
|                |  2: Insert by bulkmode. 20rec x 1000times              |
|                |  3: read each record                                   |
|                |  4: read each record with snapshot                     |
|                |  5: read range. 20rec x 1000times                      |
|                |  6: read range with snapshot . 20rec x 1000times       |
|                |  7: update                                             |
|                |  8: update in transaction. 20rec x 1000times           |
|----------------|--------------------------------------------------------|
ex)
bench_tdclcpp_c_vc140_64u.exe "tdap://localhost/test?dbfile=test.bdf" 0 -1

bench_query_xxx measures the speed of getting a similar result with the following SQL:

select
   `user`.`id`
   ,`user`.`name`
   ,`extention`.`comment`
   ,`groups`.`name` as `group_name`
from
   `user` INNER JOIN `extention` 
      ON `user`.`id`  = `extention`.`id`
    LEFT JOIN `groups` 
      ON `user`.`group`  = `groups`.`code`
where
    `user`.`id` > 0 and `user`.`id` <= 15000;

The command line options are:

bench_query_xxx createdb hostname type n
|----------------|--------------------------------------------------------|
| option name    | description                                            |
|----------------|--------------------------------------------------------|
| createdb       | Specify 0 or 1 to determine whether or not to create a |
|                | new test database. The default is 1.                   |
|----------------|--------------------------------------------------------|
| hostname       | Specify the name or IP address of the location database|
|                | .The default is localhost.                             |
|----------------|--------------------------------------------------------|
| type           | Specific numbers, the contents of the query.           |
|                | The default is 15.                                     |
|                | 1: Read 15,000 records from the user table             |
|                | 3: JOIN the comment field of the extention table on the| 
|                |    results of the 1                                    |
|                | 7: JOIN the name of the table groups the results of the|
|                |    3                                                   |
|                | 5: JOIN the name of the groups on the results of the 1 |
|                |+8: Display the execution progress of repeat            |
|----------------|--------------------------------------------------------|
| n              | Specifies the number of executions of the query        |
|                | specified by type. The default is 100.                 |
|----------------|--------------------------------------------------------|
ex)
bench_query_vc140_64u 0 localhost 15 100

C++ O/R mapping source code generator

ormsrcgen (32|64) is a source code generator for C++ O/R mapping.

C++ does not allow to define classes dynamically. So we need to generate model classes with the source code generator. You can use O/R mapping fast and easy in C++ with it.

Files

Related files of the generator is in source/global/ormsrcgen/template. The descriptions of each files are:

Edit fieldNameList_sample.txt and template.cnf as needed.

Command-line options

Command line options are:

command line option:
  -d [ --database_uri ] database uri ex:tdap://hostname/dbname?dbfile=trnasctd_schema
  -t [ --table_name ] table name.
  -c [ --class_name ] class name.
  -f [ --conf_name ] configuration file.

-d :Specify the database URI.
-t :Specify the table name to generate the model class.
    The class is generated for each table.
-c :Specify the name of the model class.
-f :Specify the path of configuration file.

In many cases, you can use same configuration file even if tables are different. Template of configuration file is source/global/ormsrcgen/template/template.cnf. You can copy and edit it.

Descriptions of the configuration file

Query executer

querystmts is a program that execute the Transactd query that has been described in XML file. If you pass an XML file to querystmts, it executes the queries and outputs the result to the stdout.

To make Transactd query XML file(s), we need the querybuilder program. But querybuilder has not been released yet. It will be released soon.

6. Bug reporting, requests and questions