我有以下例子:
@Transactional(propagation=Propagation.SUPPORTS, readOnly=true)
public class MyServiceImpl implements MyService {
...
@Transactional(propagation=Propagation.REQUIRED, readOnly=false)
public TransactionResponse addMyEntity(MyEntity e) throws SQLException{
...
}
...
}
And in my applicationContext:
<tx:annotation-driven transaction-manager="txManager" />
我现在想在交易停止后添加一个拦截器,如果扔掉了一张空洞。 我如何能够这样做?
预 收
http://www.ohchr.org。
我试图澄清我试图做些什么:
我有一位世界展望组织,它坚持一些关于非行的信息,并回复(如果情况有错的话,那就是一个大豆和一种错误。)
如有例外情况增加,我需要:
- Rollback the transaction
- Build the response with the error message and return it to the client.
它就像在春季交易代理中的一种尝试/捕获物。