Set up the session by running a set of statements before benchmark execution begins. The path of the file where a set of statements defined should be added in <sessionsetupfile> </sessionsetupfile>
()
| 739 | * </sessionsetupfile> |
| 740 | */ |
| 741 | protected void setupSession() { |
| 742 | try { |
| 743 | String setupSessionFile = configuration.getSessionSetupFile(); |
| 744 | if (setupSessionFile == null || setupSessionFile.isEmpty()) { |
| 745 | return; |
| 746 | } |
| 747 | |
| 748 | String statements = new String(Files.readAllBytes(Paths.get(setupSessionFile))); |
| 749 | if (statements.isEmpty()) { |
| 750 | return; |
| 751 | } |
| 752 | |
| 753 | try (Statement stmt = conn.createStatement()) { |
| 754 | stmt.execute(statements); |
| 755 | } |
| 756 | // conn.commit(); |
| 757 | } catch (SQLException | IOException ex) { |
| 758 | throw new RuntimeException("Failed setting up session", ex); |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | /** |
| 763 | * Invoke a single transaction for the given TransactionType |