@Provides @Singleton // Note: we need to inject the pooled DataSource here, not the (direct) one from EmbeddedDB protected GlobalLocker provideGlobalLocker(final DataSource dataSource, final EmbeddedDB embeddedDB) throws IOException { if (EmbeddedDB.DBEngine.MYSQL.equals(embeddedDB.getDBEngine())) { return new MySqlGlobalLocker(dataSource); } else if (EmbeddedDB.DBEngine.POSTGRESQL.equals(embeddedDB.getDBEngine())) { return new PostgreSQLGlobalLocker(dataSource); } else { return new MemoryGlobalLocker(); } }
protected synchronized void executePostStartupScripts() throws IOException { final String databaseSpecificDDL = "org/killbill/billing/util/" + "ddl-" + instance.getDBEngine().name().toLowerCase() + ".sql"; installDDLSilently(databaseSpecificDDL);
@Provides @Singleton // Note: we need to inject the pooled DataSource here, not the (direct) one from EmbeddedDB protected GlobalLocker provideGlobalLocker(final DataSource dataSource, final EmbeddedDB embeddedDB) throws IOException { if (EmbeddedDB.DBEngine.MYSQL.equals(embeddedDB.getDBEngine())) { return new MySqlGlobalLocker(dataSource); } else if (EmbeddedDB.DBEngine.POSTGRESQL.equals(embeddedDB.getDBEngine())) { return new PostgreSQLGlobalLocker(dataSource); } else { return new MemoryGlobalLocker(); } }
protected synchronized void executePostStartupScripts() throws IOException { final String databaseSpecificDDL = "org/killbill/billing/util/" + "ddl-" + instance.getDBEngine().name().toLowerCase() + ".sql"; installDDLSilently(databaseSpecificDDL);