added comment

This commit is contained in:
Athou
2014-08-13 10:12:18 +02:00
parent ea957e297c
commit 4e9266e2d5

View File

@@ -16,6 +16,7 @@ public abstract class UnitOfWork<T> {
protected abstract T runInSession() throws Exception;
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);
final Session session = newSession ? sessionFactory.openSession() : sessionFactory.getCurrentSession();