mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
added comment
This commit is contained in:
@@ -16,6 +16,7 @@ public abstract class UnitOfWork<T> {
|
|||||||
protected abstract T runInSession() throws Exception;
|
protected abstract T runInSession() throws Exception;
|
||||||
|
|
||||||
public T run() {
|
public T run() {
|
||||||
|
// if newSession is false, we already are in a unit of work and roll back/commit will happen in the wrapping unit of work
|
||||||
boolean newSession = !ManagedSessionContext.hasBind(sessionFactory);
|
boolean newSession = !ManagedSessionContext.hasBind(sessionFactory);
|
||||||
|
|
||||||
final Session session = newSession ? sessionFactory.openSession() : sessionFactory.getCurrentSession();
|
final Session session = newSession ? sessionFactory.openSession() : sessionFactory.getCurrentSession();
|
||||||
|
|||||||
Reference in New Issue
Block a user