In tests we find our `#inSession` and `#inTransaction` methods very
useful.  Which got me thinking that maybe we should support these on
SessionFactory directly:

public interface SessionFactory ... {
    ...
    void inSession(Consumer<Session> action);
    void inTransaction(Consumer<Session> action);
    void inTransaction(Session session, Consumer<Session> action);
}

and maybe even:

public interface Session ... {
    void inTransaction(Consumer<Session> action);
}


Objections?
_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to