Chapter 8. Table configuration

Table configuration is explained on DiscRack example (directory <dods_output>/examples/discrack). The table parameters are defined on three levels.

The first level is DatabaseManager level. On this level can be defined the following parameters (all information are optional):

DatabaseManager.defaults.lazyLoading = true 
DatabaseManager.defaults.maxExecuteTime = 200
DatabaseManager.defaults.AllReadOnly = false 

The second level is database level. On this level can be defined the following parameters (all information are optional):

DatabaseManager.DB.<database_name>.lazyLoading = false 
DatabaseManager.DB.<database_name>.maxExecuteTime = 350
DatabaseManager.DB.<database_name>.AllReadOnly = false 

The third level is table level. In the case of DiscRack example, there are two tables: Disc and person. The tables can have the following parameters:

# 
# Table Disc - table configuration 
# DatabaseManager.DB.DiscRack.Disc.readOnly = false 
DatabaseManager.DB.DiscRack.Disc.lazyLoading = false 
DatabaseManager.DB.DiscRack.Disc.maxExecuteTime = 150 
# 
# Table Person - table configuration 
# DatabaseManager.DB.DiscRack.person.readOnly = true 
DatabaseManager.DB.DiscRack.person.lazyLoading = false 
# DatabaseManager.DB.DiscRack.person.maxExecuteTime = 150 

Table defaults on DatabaseManager and Database are default values for all application's tables. If any of these parameters is defined on the Database level, that value is used as a default for all tables. If any of the parameters is not defined on the Database level, then, if it is defined on the DatabaseManager level, this value is used. If any of these parameters is not defined neither on the Database, nor on DatabaseManager level, DODS uses its own program defaults. For lazyLoading, program default is false, for maxExecuteTime 0 and for readOnly and AllReadOnly false.

If any of parameters lazyLoading or maxExecuteTime is defined on the table level, that value is used. If not, the default value for all tables is used (explained in previous paragraph).

Table parameter readOnly is true if the table is read-only, otherwise is false. If read-only is true, the operations: insert, update or delete on the tables are not possible.

If parameter AllReadOnly is defined and set to true (it can be defined on DatabaseManager or Database level), all applications will be read-only. In that case, table parameter readOnly is ignored. Only, If AllReadOnly is set to true and readOnly attribute of the table is set to false, warning is written to log during table initialization. In runtime exception is thrown on attempt of writing to that table.

Parameter lazyLoading is true if table supports lazy-loading, otherwise is false.

Parameter maxExecuteTime is time for query execution. Every query that is executed longer than maxExecuteTime is printed (SQL statement, execution time and maxExecutionTime) in application's log file.