X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;ds=inline;f=test%2Fenterprise%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Ftest%2Ftransactions%2FSimpleTransactionManager.java;h=a3d57102a6f2fe4d3f324e6d00598d00a65e0e4e;hb=876e802f0d26431914da66729e6d3652de299055;hp=81a5bfad36f3479957d42a16a2c67aae6301fab8;hpb=04aaa314df4d0513fd543a1c151a479a266cf7ed;p=utils diff --git a/test/enterprise/src/main/java/org/wamblee/test/transactions/SimpleTransactionManager.java b/test/enterprise/src/main/java/org/wamblee/test/transactions/SimpleTransactionManager.java index 81a5bfad..a3d57102 100644 --- a/test/enterprise/src/main/java/org/wamblee/test/transactions/SimpleTransactionManager.java +++ b/test/enterprise/src/main/java/org/wamblee/test/transactions/SimpleTransactionManager.java @@ -21,41 +21,45 @@ import java.util.List; import javax.transaction.UserTransaction; import org.wamblee.general.ThreadSpecificProxyFactory; +import org.wamblee.general.ThreadSpecificProxyFactory.CreationCallback; import org.wamblee.test.persistence.JpaBuilder; /** * *
* Simple transaction manager provides a simple mechanism to manage transactions - * in test code through the {@link UserTransaction} object. - * To construct the transaction manager use: + * in test code through the {@link UserTransaction} object. To construct the + * transaction manager use: *
+ * *- * SimpleTransactionManager manager = - * new SimpleTransactionManager(new DefaultUserTransactionFactory()); + * SimpleTransactionManager manager = new SimpleTransactionManager( + * new DefaultUserTransactionFactory()); ** *
* Next, add resources to manage using {@link #addResource(TransactionResource)}: + * *
- * manager.addResource(jpaTester.getJpaBuilder()); + * manager.addResource(jpaTester.getJpaBuilder()); **
- * As you can see from the above, {@link JpaBuilder} is a resource that can be used - * so this mechanism can be used with JPA testing. + * As you can see from the above, {@link JpaBuilder} is a resource that can be + * used so this mechanism can be used with JPA testing. *
* *
- * The next step is to manage transactions using the standard UserTransaction
- * APIs:
+ * The next step is to manage transactions using the standard
+ * UserTransaction
APIs:
*
* UserTransaction transaction = manager.getTransaction(); * transaction.begin(); * * ... do work... * - * transaction.commit(); + * transaction.commit(); ** * @author Erik Brakkee @@ -64,9 +68,9 @@ import org.wamblee.test.persistence.JpaBuilder; public class SimpleTransactionManager { private UserTransactionFactory factory; - private ThreadSpecificProxyFactory