From: erik Date: Tue, 27 Jul 2010 20:47:14 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.5~49 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=78b6249a7f02ac7d390c31c9a88326845f0a0a86;p=utils --- diff --git a/test/enterprise/src/main/java/org/wamblee/test/persistence/JpaBuilder.java b/test/enterprise/src/main/java/org/wamblee/test/persistence/JpaBuilder.java index d50ca76e..223971c6 100644 --- a/test/enterprise/src/main/java/org/wamblee/test/persistence/JpaBuilder.java +++ b/test/enterprise/src/main/java/org/wamblee/test/persistence/JpaBuilder.java @@ -151,15 +151,19 @@ public class JpaBuilder implements TransactionResource { * passing it the entity manager. Use of this method saves a lot of typing * for applications. * + * This method requires the transaction to succeed. Otherwise the test will + * fail. See {@link #execute(JpaUnitOfWork, TransactionResultCallback)} and + * {@link RequireTransactionStatus} for more possibilities. + * * @param aWork * Work to execute. * * @return The return value of the execute method of the unit of work. */ public T execute(JpaUnitOfWork aWork) throws Exception { - return execute(aWork, new LoggingTransactionResultCallback(Level.INFO)); + return execute(aWork, new RequireTransactionStatus(TransactionResult.COMMIT)); } - + /** * Executes a unit of work. This creates an entitymanager and runs the * {@link JpaUnitOfWork#execute(EntityManager)} within a transaction,