………………………………………………………… public List<Area> getAreas() throws SQLException { List<Area> result = null; try { // 开启事务 sqlMapClientTemplate.getSqlMapClient().startTransaction(); // 从数据库中得到版块列表,并返回 result = sqlMapClientTemplate.queryForList("getAreas"); // 语句最后提交事务 sqlMapClientTemplate.getSqlMapClient().commitTransaction(); }finally{ // 如果用户没有提交成功,就rollback,如果有提交只是简单的结束事务 sqlMapClientTemplate.getSqlMapClient().endTransaction(); } return result; } ………………………………………………