"关闭连接失败!"); throw new WorkflowException("关闭连接失败!"); } } public FlushMode getFlushMode() { return flushMode; } public void setFlushMode(FlushMode flushMode) { this.flushMode = flushMode; } } public interface TransactionCallback { Object doInTransaction(Connection conn); }调用伪代码: public void methodA(){ TransactionTemplate transactionTemplate=new TransactionTemplate(); transactionTemplate.execute(new TransactionCallback(){ public Object doInTransaction(Connection conn) { client.method1("1"); our.method2(); client.method3("l"); return null; } }); } |