OPENJPA-1342: A simple mechanics to test with container managed transaction semantics

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@824384 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2009-10-12 15:28:02 +00:00
parent eb41b03ff4
commit 60b8e64ec9
4 changed files with 4 additions and 5 deletions

View File

@ -53,5 +53,4 @@ public class JTAManagedRuntime implements ManagedRuntime {
public void setRollbackOnly(Throwable cause) throws Exception {
txm.getTransaction().setRollbackOnly(cause);
}
}

View File

@ -60,9 +60,10 @@ public class SimpleTransaction implements Transaction {
}
}
// do nothing
status = errors.isEmpty() ? Status.STATUS_COMMITTED : Status.STATUS_ROLLEDBACK;
for (Synchronization synch : synchs) {
try {
synch.afterCompletion(Status.STATUS_COMMITTED);
synch.afterCompletion(status);
} catch (Throwable t) {
errors.add(t);
}

View File

@ -29,8 +29,7 @@ import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
/**
* A very very simple Transaction Manager for testing JTA resource
* without a container.
* A very simple Transaction Manager for testing JTA resource without a container.
* <br>
* Provides a single transaction per-thread model.
*