You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I'm not mistaken, using option 1 would not result in a rollback being executed if an exception occurs in my block of work, while a rollback would be attempted when using option 2 and exception occurs.
Assuming this is the case, wouldn't it make sense to offer something like public <T> T withLocalTx(Supplier<T> task) alongside the existing public void withLocalTx(Runnable task)? I often find myself in lengthy transactions that in the end produce some value which I want to return.
Not sure if the above is a feature request or if I'm just missing something...
As far as I understand it, there are two general ways for running transactions:
If I'm not mistaken, using option 1 would not result in a rollback being executed if an exception occurs in my block of work, while a rollback would be attempted when using option 2 and exception occurs.
Assuming this is the case, wouldn't it make sense to offer something like
public <T> T withLocalTx(Supplier<T> task)
alongside the existingpublic void withLocalTx(Runnable task)
? I often find myself in lengthy transactions that in the end produce some value which I want to return.Not sure if the above is a feature request or if I'm just missing something...
Originally posted by @fullben in #19
The text was updated successfully, but these errors were encountered: