The Boot Procedure#

During startup, the application searches for configuration files in predefined locations, e.g., to establish a connection to the database.

The following describes how the application starts (boot item).

  • The application searches in the webapps directory of the Servlet Container for a file named Torque.<Context>.properties. If the application is installed under webapps/demo, for example, it would search for the file Torque.demo.properties. This allows multiple instances to be run in the same container.

  • If this file is found, the configuration of the database connection is taken from there. Within this file, the application looks for a property named ALLEGRA_HOME. If this property is found, this value is used for the home directory until the database connection is established. After establishing the database connection, the value from the database is taken over. If it is undefined, the database is initialized with the value of ALLEGRA_HOME.

  • If ALLEGRA_HOME has not been set at this point, the application looks for an environment variable ALLEGRA_BOOT. If this is found, it looks in the corresponding directory for a file Torque.properties. If this is found, the database connection is established with this configuration.

  • Within this file, the application looks for a property named ALLEGRA_HOME. If available, it will use this value until it is overwritten by the database configuration. If the database has not yet been configured, the ALLEGRA_HOME value is used to initialize the database.

  • If either ALLEGRA_BOOT or Torque.properties were not found, the application looks for an environment variable ALLEGRA_HOME.

  • If this is found, it looks in the corresponding directory for a file Torque.properties. If this is found, the database connection is established with this configuration.

  • Within this file, the application looks for a property named ALLEGRA_HOME. If available, it will use this value until it is overwritten by the database configuration. If the database has not yet been configured, the ALLEGRA_HOME value is used to initialize the database.

  • If ALLEGRA_HOME has not been set at this point, it searches the classpath for a file Torque.properties. Since a default configuration is in the file found, the application usually does not work.