ERROR TransactionInterceptor:307 - Application exception overridden by commit exception
错误原因可能为:
Remember only unchecked exceptions cause rollbacks in spring transactions.
What is happening is that you're catching the unchecked exception, converting it to a checked exception and then propogating it. The transaction manager does not rollback for RecordExistsException and thinks that your first transaction has succeded. Thats why it tries to save your child objects. You should annotate your service with
Code:
@Transactional (rollbackFor= RecordExistsException.class)
or have your exception class extend RuntimeException.
解决办法:
OK, the way I read that an exception occurs and it does indeed do a commit. I would presume there must be a rollback rule defined telling it to do this.
Before Spring2.0 might look like this.
<prop key="*">PROPAGATION_REQUIRED, -com.mydomain.exception.MyException</prop>
http://www.springframework.org/docs/reference/transaction.html#transaction-declarative-txadvice-settings
分享到:
相关推荐
《Spring Dubbo与Spring Boot整合应用详解》 在现代企业级开发中,Spring框架和其衍生的Spring Boot已经成为Java开发者的重要工具。同时,随着微服务架构的流行,Dubbo作为一款高效率的服务治理框架,也得到了广泛...
Note that the start method is abstract and must be overridden. The init and stop methods have concrete implementations that do nothing. Calling Platform.exit() is the preferred way to explicitly ...
40. **Overridden method**:重写方法是指子类重新定义父类中的方法,保持相同的签名但可能有不同的实现。 41. **Abstract**:抽象类是包含抽象方法的类,不能实例化,只能被继承。 42. **Interface**:接口是包含...
Application A lock resource defined by an application. The lock manager knows nothing about the resource format. It simply compares the 'strings' representing the lock resources to determine whether ...
Public and protected class members are documented only when they are normally used in application programs or derived classes. Occasionally, private members are listed because they override a public ...
Java的API(Application Programming Interface)提供了一系列预先定义好的类和接口,如集合(Collection)接口,它允许开发者管理和操作数据集合。容器(Container)类如JFrame或JPanel,用于构建GUI(Graphics ...
构造方法在Java中用于初始化新创建的对象,它们不能被重写(overridden),但可以被重载(overloaded)。选项A正确,B、C、D错误。重写是指子类提供与父类相同名称和参数列表的方法,但具有不同的实现;而重载则是在...
异常处理相关的英语词汇有:Exception(异常)、Runtime Exception(运行时异常)、ArithmeticException(算术异常)、IllegalArgumentException(非法参数异常)、ArrayIndexOutOfBoundsException(数组索引越界...
Notification that the web application initialization process is starting. Cookie - class javax.servlet.http.Cookie. Creates a cookie, a small amount of information sent by a servlet to a Web browser,...
The device can be installed with ResetPipeRequestRetryCount set to any value by changing FTDIBUS.INF as shown in the following fragment. [FtdiBus_AddService.AddReg] HKR,Parameters,"RetryResetCount",...
eclipse 4.9.0 插件org.apache.axis2.eclipse.service.plugin_1.7.8
8. **Error与Exception**:Error通常代表系统级别的问题,可能难以恢复,而Exception是程序运行时可预见的异常,可以通过异常处理机制进行处理。 9. **final, finally, finalize的区别**:final用于声明不可更改的...
- FIX: In the method TFlexPanel.ResizeSelection exception occurred when the number of selected items changed while the method was running. - ADD: Added the method TFlexControl.DoNeedHint - allows ...
This setting defines the device family targeted by the application. It can include iPhone, iPad, or both. Specifying the targeted device family helps ensure that the application is optimized for the ...
Methods such as `description`, `isEqual:`, and `hash` are provided by `NSObject` and can be overridden by subclasses. ##### Runtime Functions Runtime functions allow developers to perform low-level...
The color tracking is enabled so that our material diffuse colors are overridden by our vertex colors. To do this we ll enable the "All Geometries Lit" and "Use Material Diffuse Color" options in the...
23. **Extends, Base class, Super class, Overloaded method, Overridden method**:继承、基类、超类、方法重载和方法重写,是面向对象的特性。 24. **Public, Private, Protected, Static, Abstract, Interface,...
Exception是程序运行时发生的不正常情况的类,包括Runtime Exception(运行时异常)、Arithmetic Exception(算术异常)、IllegalArgumentException(非法数据异常)等。异常处理的关键字有try、catch、finally、...
* Setting MTSDataModule.AutoComplete to False in the IDE is overridden and set back to True at run time (Quality Central 4716).* Calls to ApplyUpdates(-1) on a TMTSDataModule do not work properly ...
描述中提到的问题是尝试在后台声明一个Web服务,但在前台调用时抛出了`java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage`的异常。这通常意味着在处理...