I propose we add the following methods:
{code} interface SessionFactory { void inTransaction(Consumer<Session> action); void inSession(Consumer<Session> action); }
interface Session ... { void inTransaction(Consumer<Session> action); <T> T inTransaction(Function<Session,T> action);
// or should these be `#doWork` to match the existing names?
default void inJdbc(Consumer<Connection> action) { inJdbc( action, false ) ; }
default <T> T inJdbc(Function<Session,T> action) { return inJdbc( action, false ) ; } void inJdbc(Consumer<Connection> action, boolean isolated); <T> T inJdbc(Function<Session,T> action, boolean isolated); } {code} |
|