From a9a200500215d0db19666fa9fe3c1b5f2a076ac3 Mon Sep 17 00:00:00 2001 From: erik Date: Sat, 17 Jul 2010 21:39:55 +0000 Subject: [PATCH] --- .../OpenTransactionInViewRequestCycle.java | 19 ++++++++++++------- .../wicket/transactions/package-info.java | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) 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 -- 2.31.1