Re: [hibernate-dev] inSession / inTransaction

2019-01-07 Thread Chris Cranford
I have no objections to exposing them directly rather than being part of the test infrastructure. On 12/20/18 5:16 PM, Steve Ebersole wrote: > On Thu, Dec 20, 2018 at 1:33 PM Gunnar Morling wrote: > >> Hey, >> >> When discussing this before, there were some doubts about its actual >> usefulness i

Re: [hibernate-dev] inSession / inTransaction

2018-12-20 Thread Steve Ebersole
On Thu, Dec 20, 2018 at 1:33 PM Gunnar Morling wrote: > Hey, > > When discussing this before, there were some doubts about its actual > usefulness in non-testing, real-world code. E.g. you'd typically > interact with multiple DAOs/repositories etc. and would have to > somehow pass the session to

Re: [hibernate-dev] inSession / inTransaction

2018-12-20 Thread Gunnar Morling
Hey, When discussing this before, there were some doubts about its actual usefulness in non-testing, real-world code. E.g. you'd typically interact with multiple DAOs/repositories etc. and would have to somehow pass the session to each of them. One other thought is that inTransaction() should all

[hibernate-dev] inSession / inTransaction

2018-12-20 Thread Steve Ebersole
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 action); void inTransaction(Consumer action); void inT