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