mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-14 06:45:21 +00:00
Revert "ENH: allow server startup without running ddl and thus allowing starting with the database not yet up and later lazily initializing the database and running ddl"
This reverts commit af0f9a4d15.
This commit is contained in:
1 parent
5bf19647fe
commit
e5036990f2
7 files changed
+4
-233
No files matched your search
@@ -56,10 +56,6 @@ public class DatabasePlatformFactory {
|
||||
if (config.getDataSourceConfig().isOffline()) {
|
||||
throw new PersistenceException("DatabasePlatformName must be specified with offline mode");
|
||||
}
|
||||
if (config.getTenantMode().isDynamicDataSource()) {
|
||||
throw new IllegalStateException("DatabasePlatform must be explicitly set on ServerConfig for TenantMode "
|
||||
+ config.getTenantMode());
|
||||
}
|
||||
// guess using meta data from driver
|
||||
return byDataSource(config.getDataSource());
|
||||
|
||||
|
||||
@@ -179,7 +179,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
private final long slowQueryMicros;
|
||||
private final SlowQueryListener slowQueryListener;
|
||||
private final boolean disableL2Cache;
|
||||
private final boolean initDatabase;
|
||||
private boolean shutdown;
|
||||
|
||||
/**
|
||||
@@ -228,7 +227,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
this.tempFileProvider = config.getConfig().getTempFileProvider();
|
||||
this.ddlGenerator = config.initDdlGenerator(this);
|
||||
this.scriptRunner = new DScriptRunner(this);
|
||||
this.initDatabase = !config.getConfig().skipInitDatabase();
|
||||
|
||||
configureServerPlugins();
|
||||
// Register with the JVM Shutdown hook
|
||||
@@ -253,21 +251,13 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initDatabase(boolean online) {
|
||||
if (!config.isDocStoreOnly()) {
|
||||
ddlGenerator.execute(online);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute all the plugins with an online flag indicating the DB is up or not.
|
||||
*/
|
||||
public void executePlugins(boolean online) {
|
||||
if (initDatabase) {
|
||||
initDatabase(online);
|
||||
if (!config.isDocStoreOnly()) {
|
||||
ddlGenerator.execute(online);
|
||||
}
|
||||
|
||||
for (Plugin plugin : serverPlugins) {
|
||||
plugin.online(online);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user