Wiki Spaces


Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack


Page tree
Skip to end of metadata
Go to start of metadata

If you want your existing module or any new module to work on Platform 2.0 and any older version, you need to be aware of the requirement to use DbSessionFactory instead of the SessionFactory class in your module's DAOs.

Supporting only Platform 2.0+

If you only want to support Platform 2.0 and above then you can continue to use SessionFactory.

Supporting Platform 2.0+ and earlier supported OpenMRS versions (This is the recommended approach)

The DBSessionFactory class has been introduced in Platform 2.0, 1.11.3, 1.10.2, 1.9.9. It is not available in older releases so to use it you have to bump your module's required version of Platform to either 2.0, 1.11.3, 1.10.2, 1.9.9. For example if your module used to support 1.9.4 and above then you would have to declare <require_version>1.11.3, 1.10.2 - 1.10.*, 1.9.9 - 1.9.*</require_version> in your module's config.xml and use the 1.9.9 version of openmrs-api dependency in your pom.xml. It entails that any implementation that wants to continue to use your module will have to run one of the quoted versions of OpenMRS Platform. An example of changes in a module can be found at

Requirements for implementations that cannot upgrade to the latest supported versions

Any implementation that cannot upgrade to the latest maintenance version of Platform will have to fork your module and create a custom build that declares an aware of dependency on It is a module that includes the DbSessionFactory class. The implementation will have to install that module in addition to the forked module. An example of changes required in a forked module can be found at 

Supporting Platform 2.0+ and all earlier versions

For module developers who do not want to require upgrading to the latest maintenance version of the platform, you could use an alternative approach as done by the xforms module at

Other Resources

For more information regarding supporting multiple platform versions, take a look at this guide.

  • No labels