diff --git a/pom.xml b/pom.xml index 7c21e2b..bb59d35 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 net.helenus helenus-core - 2.0.31-SNAPSHOT + 2.0.32-SNAPSHOT jar helenus diff --git a/src/main/java/net/helenus/core/UnitOfWork.java b/src/main/java/net/helenus/core/UnitOfWork.java index bba8b85..8635f43 100644 --- a/src/main/java/net/helenus/core/UnitOfWork.java +++ b/src/main/java/net/helenus/core/UnitOfWork.java @@ -8,7 +8,7 @@ import java.util.*; /** Encapsulates the concept of a "transaction" as a unit-of-work. */ -public class UnitOfWork implements AutoCloseable { +public class UnitOfWork implements AutoCloseable { protected static ClassconflictExceptionClass = ConflictingUnitOfWorkException.class; private final List nested = new ArrayList<>(); private final HelenusSession session; @@ -52,7 +52,7 @@ public class UnitOfWork implements AutoCloseable { } public Set cacheLookup(String key) { - UnitOfWork p = this; + UnitOfWork p = this; do { Set r = p.getCache().get(key); if (r != null) { @@ -73,9 +73,9 @@ public class UnitOfWork implements AutoCloseable { * Checks to see if the work performed between calling begin and now can be committed or not. * * @return a function from which to chain work that only happens when commit is successful - * @throws ConflictingUnitOfWorkException when the work overlaps with other concurrent writers. + * @throws T when the work overlaps with other concurrent writers. */ - public PostCommitFunction commit() throws Exception { + public PostCommitFunction commit() throws T { // All nested UnitOfWork should be committed (not aborted) before calls to commit, check. boolean canCommit = true; TreeTraverser traverser = TreeTraverser.using(node -> node::getChildNodes); @@ -122,8 +122,8 @@ public class UnitOfWork implements AutoCloseable { } } // else { - // Constructor ctor = clazz.getConstructor(conflictExceptionClass); - // Object object = ctor.newInstance(new Object[] { String message }); + // Constructor ctor = clazz.getConstructor(conflictExceptionClass); + // T object = ctor.newInstance(new Object[] { String message }); // } return new PostCommitFunction(this, postCommit); }