X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;ds=inline;f=wicket%2Fjoe%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fwicket%2Ftransactions%2FOpenTransactionInViewRequestCycle.java;h=094057015e59d2ef06ce65ed22e7df26c5f362fb;hb=60323e15f34709e99ca5c96584e5b84f6740b176;hp=4aae401627006cd5fe26d0a1cd87ef6a5e741cbf;hpb=518af502068de1be15b0f83be89030d6e9bf081f;p=utils diff --git a/wicket/joe/src/main/java/org/wamblee/wicket/transactions/OpenTransactionInViewRequestCycle.java b/wicket/joe/src/main/java/org/wamblee/wicket/transactions/OpenTransactionInViewRequestCycle.java index 4aae4016..09405701 100644 --- a/wicket/joe/src/main/java/org/wamblee/wicket/transactions/OpenTransactionInViewRequestCycle.java +++ b/wicket/joe/src/main/java/org/wamblee/wicket/transactions/OpenTransactionInViewRequestCycle.java @@ -36,7 +36,7 @@ import org.apache.wicket.protocol.http.WebRequestCycle; * wicket. It provides a custom request cycle that uses the * {@link UserTransaction} to make sure that all work is done within a single * transaction. In Hibernate context, this is referred to as open session in - * view. + * view. *
* *@@ -68,8 +68,9 @@ import org.apache.wicket.protocol.http.WebRequestCycle; */ public class OpenTransactionInViewRequestCycle extends WebRequestCycle { - private static final Logger LOG = Logger.getLogger(OpenTransactionInViewRequestCycle.class.getName()); - + private static final Logger LOG = Logger + .getLogger(OpenTransactionInViewRequestCycle.class.getName()); + private static final String JAVA_COMP_USER_TRANSACTION_JNDI = "java:comp/UserTransaction"; private UserTransaction userTransaction; @@ -102,15 +103,19 @@ public class OpenTransactionInViewRequestCycle extends WebRequestCycle { @Override protected void onEndRequest() { try { - if ( LOG.isLoggable(Level.FINEST)) { - LOG.finest("Transaction status: " + userTransaction.getStatus()); + if (LOG.isLoggable(Level.FINEST)) { + LOG + .finest("Transaction status: " + + userTransaction.getStatus()); } if (userTransaction.getStatus() == Status.STATUS_ACTIVE) { userTransaction.commit(); } else if (userTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) { userTransaction.rollback(); - } else { - LOG.warning("Transaction status is '" + userTransaction.getStatus() + "' not committing or rolling back"); + } else { + LOG.warning("Transaction status is '" + + userTransaction.getStatus() + + "' not committing or rolling back"); } } catch (Exception e) { throw new RuntimeException("Could not commit transaction", e);