-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a reproduction program for sesscion close case
- Loading branch information
1 parent
225d629
commit 778ce05
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
modules/cases/src/main/java/com/tsurugidb/tsubakuro/examples/sesscionClose/Main.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.tsurugidb.tsubakuro.examples.sesscionClose; | ||
|
||
import com.tsurugidb.tsubakuro.exception.ServerException; | ||
import com.tsurugidb.tsubakuro.common.Session; | ||
import com.tsurugidb.tsubakuro.common.SessionBuilder; | ||
import com.tsurugidb.tsubakuro.sql.SqlClient; | ||
|
||
|
||
public final class Main { | ||
private static String url = System.getProperty("tsurugi.dbname"); | ||
|
||
public static void main(String[] args) { | ||
for (int i = 0; i < 50; i++) { | ||
try { | ||
Session session = SessionBuilder.connect(url).create(); | ||
SqlClient sqlClient = SqlClient.attach(session); | ||
var futureTransaction = sqlClient.createTransaction(); | ||
|
||
session.close(); | ||
} catch (Exception e) { | ||
System.out.println(e); | ||
} | ||
} | ||
System.out.println("================"); | ||
for (int i = 0; i < 50; i++) { | ||
try { | ||
Session session = SessionBuilder.connect(url).create(); | ||
SqlClient sqlClient = SqlClient.attach(session); | ||
var futureTransaction = sqlClient.createTransaction().get(); | ||
|
||
session.close(); | ||
} catch (Exception e) { | ||
System.out.println(e); | ||
} | ||
} | ||
} | ||
|
||
private Main(String[] args) { | ||
} | ||
} |