public static <T> T doWith(
            final ExecSessionInternal sessionInternal,
            final ExecAction<T> action)
            throws ExecutionException {
        ExecInternal.sessionInternal.set(sessionInternal);
        Exec.setThreadLocalSession(sessionInternal);
        try {
            return action.run();
        } catch (final Exception ex) {
            throw new ExecutionException(ex);
        } finally {
            Exec.setThreadLocalSession(null);
            ExecInternal.sessionInternal.set(null);
        }
    }
Provides static access inside Embulk.

<p>It complements methods deprecated/removed from {@link Exec}. It is used from {@code embulk-core} internally.

<p>A plugin can technically call them via {@link ExecInternal} in {@code embulk-core} though it is strongly discouraged.
Embulk does not guarantee any compatibility in {@code embulk-core} with plugins. The plugin may easily stop working at
some point of Embulk versions. Do it at your own risk.
embulk-core/src/main/java/org/embulk/spi/ExecInternal.java