public class TargetHandle { List<Target> list; public TargetHandle() { list = new ArrayList<Target>(); } public void addTarget(Activity object, String methodName, Object ...params) { list.add(new Target(object, methodName, params)); }
@Before(Tx.class) public boolean notifyX() { try { for(Target target : list) { target.invoke(); } return true; } catch(Exception e) { e.printStackTrace(); return false; } } } public class Target { ... public void invoke() throws Exception { Method method = object.getClass().getMethod(methodName, paramTypes); method.invoke(object, params); } } public abstract class EventNotifier { TargetHandle handle = Enhancer.enhance(TargetHandle.class); ... public boolean notifyX() { return this.handle.notifyX(); } } |
在这个notify 的handle中添加多个方法,每个方法有各种sql操作, 但是中途报错后事务没有回滚,,, 波哥, 请问这个是哪里操作出了问题吗?