private static InvocationHandler createInvocationHandler(Jdbi jdbi, Class<?> extensionType) {
        return (proxy, method, args) -> {
            Handle handle = JdbiUtil.getHandle(jdbi);
            try {
                Object delegate = handle.attach(extensionType);
                return invoke(delegate, method, args);
            } finally {
                JdbiUtil.closeIfNeeded(handle);
            }
        };
    }
Proxies the extension object to bind it to the jta framework. Creates and closes the handle if needed.
spring/src/main/java/org/jdbi/v3/spring/JdbiJtaBinder.java