public void insertPerson()
{
TransactionTemplate transTmp = new TransactionTemplate(dsTransMng);
transTmp.execute(new TransactionCallback()
{
public Object doInTransaction(TransactionStatus status)
{
JdbcTemplate jdbcTmp = new JdbcTemplate(ds);
jdbcTmp.update("insert into PERSON values(10,'1000')");
jdbcTmp.update("insert into PERSON values(11,'1111')");
return null;
}
});
}
编程式事务管理
最新推荐文章于 2021-10-22 00:37:02 发布