diff --git a/modules/clients/src/main/java/com/tsurugidb/tsubakuro/examples/sessionShutdown/Main.java b/modules/clients/src/main/java/com/tsurugidb/tsubakuro/examples/sessionShutdown/Main.java index 554e466..6e1f680 100644 --- a/modules/clients/src/main/java/com/tsurugidb/tsubakuro/examples/sessionShutdown/Main.java +++ b/modules/clients/src/main/java/com/tsurugidb/tsubakuro/examples/sessionShutdown/Main.java @@ -97,12 +97,16 @@ public static void shutdown(Session session) throws IOException, ServerException } finally { System.out.println("---- finish shutdown, which takes " + (System.currentTimeMillis() - start) + " milli sec ----"); } - System.out.println("session.isAlive() = " + session.isAlive()); - } else { - while (session.isAlive()) { - System.out.println("session is still alive"); - Thread.sleep(2000); - } + Thread.sleep(100); + } + boolean detectAlive = false; + while (session.isAlive()) { + System.out.println("session is still alive"); + Thread.sleep(100); + detectAlive = true; + } + if (detectAlive) { + System.out.println("session status has changed from alive to shutdown"); } } }