@Override @Transactional(readOnly = false, rollbackFor = Throwable.class) public void updateIsSyncFromSynchroodata(Paynote paynote) { int count = 0; try { //设置手动提交 this.defaultDao.getJdbcTemplate().getDataSource().getConnection().setAutoCommit(false); String update_sql="update t_paynote set is_sync='"+paynote.getIsSync()+"',proctime='"+paynote.getProctime()+"' where pn_no='"+paynote.getPnNo()+"' and unit_no='"+paynote.getUnitNo()+"' and orderno='"+paynote.getOrderno()+"'"; count= this.defaultDao.getJdbcTemplate().update( update_sql); this.defaultDao.getJdbcTemplate().getDataSource().getConnection().commit(); }catch (Exception e) { e.printStackTrace(); try { this.defaultDao.getJdbcTemplate().getDataSource().getConnection().rollback(); } catch (SQLException e1) { e1.printStackTrace(); } }finally { try { this.defaultDao.getJdbcTemplate().getDataSource().getConnection().setAutoCommit(true); } catch (SQLException e) { e.printStackTrace(); } } }