1、获取到session对象:
Session session = this.getSession();
Transaction transaction = session.getTransaction();
transaction.begin();
session.delete("");
session.update("");
session.save("");
transaction.commit();
session.close();
2、上面的this是spring-orm-3.2.4.jar里的HibernateDaoSupport类
public abstract class org.springframework.orm.hibernate3.support.HibernateDaoSupport extends org.springframework.dao.support.DaoSupport
至此就可以在上面的transaction.begin();
到transaction.commit(); session.close();之间完成自己的事物处理了。