mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-23 07:51:04 +00:00
#2209 - Registering [default] as the default server but [default] is already registered as the default exception with hot-reload
This commit is contained in:
@@ -78,7 +78,7 @@ public class DatabaseFactory {
|
||||
Database server = createInternal(config);
|
||||
if (config.isRegister()) {
|
||||
if (config.isDefaultServer()) {
|
||||
if (defaultServerName != null) {
|
||||
if (defaultServerName != null && !defaultServerName.equals(config.getName())) {
|
||||
throw new IllegalStateException("Registering [" + config.getName() + "] as the default server but [" + defaultServerName + "] is already registered as the default");
|
||||
}
|
||||
defaultServerName = config.getName();
|
||||
|
||||
@@ -46,7 +46,12 @@ public class MainMemoryLeak {
|
||||
config.addClass(ECachedBean.class);
|
||||
config.loadFromProperties();
|
||||
|
||||
Database server1 = DatabaseFactory.create(config);
|
||||
assert server1 != null;
|
||||
|
||||
// create again for #2193
|
||||
Database server = DatabaseFactory.create(config);
|
||||
assert server != null;
|
||||
|
||||
// create a string with 10k chars
|
||||
char[] c = new char[10_000];
|
||||
|
||||
Reference in New Issue
Block a user