+ 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,
+ * passing it the entity manager. Use of this method saves a lot of typing
+ * for applications.
+ *
+ * @param aWork
+ * Work to execute.
+ * @param aTransactionResultCallback
+ * callback to notify of the result of the transaction.
+ *
+ * @return The return value of the execute method of the unit of work.
+ */
+ public <T> T execute(JpaUnitOfWork<T> aWork,
+ TransactionResultCallback aCallback) throws Exception {