Database Configuration Simplification

Summary is now used for overriding database settings used during runtime and testing. This file should be placed in Mifos Configuration Locations.


Detailed development notes from work during story 1405 follow.
list-table:: Mifos Database Connections:header-rows: 1

  • - database connection - how settings are gathered and used
  • - Mifos web application - Connection properties from (in VCS) is loaded and combined with "main.database.*" settings from Both .properties files are found via ConfigurationLocator.
  • - legacy build - "build_test_db" and "run_test" targets use "integration.database." settings in and to build JDBC connections. Mifos Configuration Locations is searched for "build_db" and "build_production_db" use different settings (main.database.) in the same .properties files. Settings in both files are combined as per the rules of the Ant <property> task (see Notes, below).
  • - legacy integration tests - "run_test" target sets Java system property "mifos.mode" to "integration". Database connection established with help from TestingService (see Notes, below).
  • - integration tests using spring - propertyConfigurer.xml loads settings from and searches Mifos Configuration Locations for "integration.database.*" settings are then used in test-context.xml to configure JDBC connection.
  • - acceptance tests - same as 'integration tests using spring' except s/integration/acceptance/
  • - acceptance tests: sql-maven-plugin - Load (formerly directly from source tree using properties-maven-plugin, then search Mifos Configuration Locations for "acceptance.database.*" settings are then referenced explicitly in POM. Set <quiet>true</quiet> in properties-maven-plugin so absence of doesn't halt the build (this removes the need for hack in acceptanceTests/pom.xml).
  • - acceptance tests: cargo - Similar to 'legacy integration tests' except set "mifos.mode" to "acceptance".


  • with ant <properties> task, properties are immutable once set: first one wins
  • with properties-maven-plugin, last one wins
  • in lieu of Maven/Spring/Ant-specific interfaces to ConfigurationLocator, all files with hardcoded paths mentioned in ConfigurationLocator should also include the string "mimics ConfigurationLocator directory search behavior" in a comment
  • TestingService encapsulates all logic necessary to have the application behave differently during acceptance and integration tests. While setting up a database connection, ConfigureSession.configure() will ask this service which settings to read, and from which properties files