ref #6241 change @date to @since
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / exception / DataChangeNoRollbackException.java
1 /**
2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.cdm.api.service.exception;
10
11 import org.springframework.transaction.interceptor.DefaultTransactionAttribute;
12
13 /**
14 * Base class for all exceptions occurring during data change actions within the service layer.
15 * NOTE: This exception needs to be thrown before any data is saved to the session as it rather forces
16 * commit then rollback. This is intended behavior to avoid full transaction rollback within longer
17 * transactions. This way we do not need an explicit method to check if a data change method will
18 * succeed or fail.<BR>
19 * To avoid rollback the class on purpose does not inherit from RuntimeException
20 * as RuntimeException leads to rollback when using {@link DefaultTransactionAttribute#rollbackOn(Throwable)}
21 * which is used by spring as default transaction attribute.
22 * @author a.mueller
23 \* @since 13.10.2011
24 *
25 */
26 public class DataChangeNoRollbackException extends Exception {
27 private static final long serialVersionUID = -5279586708452619581L;
28
29
30 public DataChangeNoRollbackException() {
31 }
32
33 public DataChangeNoRollbackException(String message) {
34 super(message);
35 }
36
37
38 }