spring.xml
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"><property name="entityManagerFactory" ref="entityManagerFactory" /></bean>
<tx:annotation-driven transaction-manager="transactionManager" order="2" /> -------①
<jpa:repositories base-package="com.iss.logic.dao" entity-manager-factory-ref="entityManagerFactory" transaction-manager-ref="transactionManager" /> ---------②
Java--->dao包:
public interface IKPIObjectDao extends IBaseDao<KPIObject, Long>{
/*spring data jpa 提供方法*/
/**
*save等
*/
}
Java--->service包: ------③
kpiObj = iKPIObjectDao.save(kpiObj);
/*下面是个调用webservice执行一个insert的方法*/
String swdlRs = callWSDL(null, null, null, "0");
System.out.println("=======ws->resoult=" + swdlRs + " 结果调用完毕====");
上述:①有查询使用 ②有个IUserdao 去掉就报错
问题:怎么可以让③中service形成事务 save和callWSDL分别是2个库