@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();
            }
        }
    }

 

相关文章:

  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
  • 2021-12-05
  • 2022-01-11
  • 2021-10-01
猜你喜欢
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案