From: erik Date: Sat, 17 Jul 2010 21:39:55 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.3~16 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=a9a200500215d0db19666fa9fe3c1b5f2a076ac3;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); diff --git a/wicket/joe/src/main/java/org/wamblee/wicket/transactions/package-info.java b/wicket/joe/src/main/java/org/wamblee/wicket/transactions/package-info.java index 8163de7d..aa536f7a 100644 --- a/wicket/joe/src/main/java/org/wamblee/wicket/transactions/package-info.java +++ b/wicket/joe/src/main/java/org/wamblee/wicket/transactions/package-info.java @@ -14,7 +14,7 @@ * limitations under the License. */ /** - * This package provide transaction support for wicket making it really easy + * This package provides transaction support for wicket making it really easy * to work with transactions. */ package org.wamblee.wicket.transactions; \ No newline at end of file