* 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.
* </p>
*
* <p>
*/
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;
@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);
* 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