Naming aside, my favorite approach is to have an "executor" available from
SessionFactory for accepting this functional-interface (lambda). The
executor would be configured with whether to isolate the work and whether
to transact it. Something like:
Executor getExecutor(boolean isolated, boolean
Most transaction systems do not support nested transactions
On Wed, Sep 14, 2016 at 3:13 PM Sanne Grinovero wrote:
> On 14 September 2016 at 21:02, Steve Ebersole wrote:
> > Also, why do you keep defining this in terms of Session, rather than
> > SessionFactory?
>
> I mentioned that same doubt
On 14 September 2016 at 21:02, Steve Ebersole wrote:
> Also, why do you keep defining this in terms of Session, rather than
> SessionFactory?
I mentioned that same doubt in my first email of this thread.
I think I prefer Session as that's what people interact with most of
the time, and it's a bet
Also, why do you keep defining this in terms of Session, rather than
SessionFactory?
On Wed, Sep 14, 2016 at 3:01 PM Steve Ebersole wrote:
> "Better" according to whom? ;)
>
> I personally very much dislike the kind of API explosion this kind of
> thing leads to.
>
>
> On Wed, Sep 14, 2016 at 2
"Better" according to whom? ;)
I personally very much dislike the kind of API explosion this kind of thing
leads to.
On Wed, Sep 14, 2016 at 2:59 PM Sanne Grinovero wrote:
> On 14 September 2016 at 20:32, Steve Ebersole wrote:
> > The problem with "execute in isolation" here is that the "isol
On 14 September 2016 at 20:32, Steve Ebersole wrote:
> The problem with "execute in isolation" here is that the "isolation" aspect
> refers to being isolated from any current transaction. It says nothing
> about whether that stuff-to-execute should itself be transacted. This is
> why, for exampl
As another option we could define something like this on SF:
T doInIsolatedSession(BiFunction work);
T doInIsolatedSession(Function work);
The spec here would be to make sure any current transaction is suspended
(JTA), a new Session opened, the function performed and the suspended
transaction i
The problem with "execute in isolation" here is that the "isolation" aspect
refers to being isolated from any current transaction. It says nothing
about whether that stuff-to-execute should itself be transacted. This is
why, for example, you see IsolationDelegate accept a `transacted` boolean
arg