title: Running Jasper Reports against an in-memory h2 datasource?
body: <p>I'm trying to run jasper reports against a live and reporting database, but any reports run against the live database throw exceptions about not finding the right tables (although the default PUBLIC schema is found). It looks like the main <code>DataSource</code> connection isn't honoring the H2 connection settings which specify <code>IGNORECASE=true</code>, as the generated columns and tables are capitalized, by my queries are not.</p>
  
  <p><strong>DataSource.groovy</strong> dataSource:  </p>
  
  <pre><code>dataSource {
      hibernate {
          cache.use_second_level_cache = false
          cache.use_query_cache = false
      }
  
      dbCreate = "create-drop" // one of 'create', 'create-drop','update'
      pooled = true
      driverClassName = "org.h2.Driver"
      username = "sa"
      password = ""
      url = "jdbc:h2:mem:testDb;MODE=PostgreSQL;IGNORECASE=TRUE;DATABASE_TO_UPPER=false"
      jndiName = null
      dialect = null 
  }
  </code></pre>
  
  <p><strong>Datasources.groovy</strong> dataSource:  </p>
  
  <pre><code>datasource(name: 'reporting') {
      environments(['development', 'test'])
      domainClasses([SomeClass])
      readOnly(false)
      driverClassName('org.h2.Driver')
      url('jdbc:h2:mem:testReportingDb;MODE=PostgreSQL;IGNORECASE=TRUE;DATABASE_TO_UPPER=false')
      username('sa')
      password('')
      dbCreate('create-drop')
      logSql(false)
      dialect(null)
      pooled(true)
      hibernate {
          cache {
              use_second_level_cache(false)
              use_query_cache(false)
          }
      }
  }
  </code></pre>
  
  <p>What fails:</p>
  
  <pre><code>JasperPrint print = JasperFillManager.fillReport(compiledReport, params,dataSource.getConnection())
  </code></pre>
  
  <p>While debugging, the only difference I've found is that the live dataSource, when injected or looked up with <code>DatasourcesUtils.getDataSource(null)</code>, is a <code>TransactionAwareDatasourceProxy</code>, and <code>DatasourcesUtils.getDataSource('reporting')</code> is a <code>BasicDataSource</code></p>
  
  <p>What do I need to do for Jasper to operate on the active in-memory H2 database?</p>
  
  <p>This failure is not reproducible against a real postgres database.</p>