#621 - EbeanServer.shutdown(true, false) followed by EbeanServerFactory create() when using the same ServerConfig give SQLException: Trying to access the Connection Pool when it is shutting down

This commit is contained in:
Robin Bygrave
2016-03-25 16:22:11 +13:00
parent 8f80280105
commit ab2789dd08
2 changed files with 13 additions and 3 deletions
@@ -10,7 +10,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class EbeanServerFactory_ServerConfigStart_Test {
@Test
public void test() {
public void test() throws InterruptedException {
ServerConfig config = new ServerConfig();
config.setName("h2");
@@ -34,6 +34,12 @@ public class EbeanServerFactory_ServerConfigStart_Test {
assertThat(OnStartupViaClass.calledWithConfig).isSameAs(config);
assertThat(ebeanServer).isNotNull();
// test server shutdown and restart using the same ServerConfig
ebeanServer.shutdown(true, false);
EbeanServer restartedServer = EbeanServerFactory.create(config);
restartedServer.shutdown(true, false);
}
public static class OnStartup implements ServerConfigStartup {