2

I wonder is it possible to run sonar 3.1.1 with h2 database? I tried to deploy sonar configured with h2 database and got following exception:

21-Jul-2012 23:32:45 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformLifecycleListener
org.sonar.api.utils.SonarException: Unable to determine database dialect to use within sonar with dialect null jdbc url jdbc:h2:tcp://localhost:9092/~/sonar

I searched a bit and the most probable cause is that 3.1.1 does not support h2. Are there any workaround to run 3.1.1 with h2?

michael nesterenko
  • 14,222
  • 25
  • 114
  • 182

1 Answers1

5

The H2 database is not listed in the Sonar pre-requisites. This is a pity because, like you, I consider it superior to Apache Derby.

The Sonar team strongly discourage the use of Derby for production environments. I read in the release notes that Derby upgrades are now disabled. Do you have a good use case for using H2 apart from dis-liking Derby? :-)

It can be tempting to setup Sonar initially with an embedded database. Problem is Sonar adoption within your organisation can go viral, eventually the day will come when someone starts to ask about backup and DR.... This is where having a proper database in place will make this transition easier.

Update

SONAR-3622: Reports the H2 database as supported. This support is coming in Sonar 3.2:

David Gageot added a comment - 04/Jul/12 5:06 AM

Latest version is more intelligent. h2 is the default for sonar>=3.2 and derby is the default for sonar<3.2

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185