views:

16

answers:

0

hi,

i have a batchUpdate which is only working on every second attempt. The batchUpdate method takes an Update string

update t_table set updated_by=lower(?), updated_date=sysdate, a= ?, b= ? where c= ? and d = ? ";

and a number of parameters - some of the parameters will be repeated so it is possible that the same update string is generated more than once

  int[] updateCount = getJdbcTemplate().batchUpdate(UPDATE_STATUS,
          new BatchPreparedStatementSetter()
public void setValues(final PreparedStatement argPs, final int argI) throws SQLException
       {
 my specific params}

   public int getBatchSize()
   {
    return alist.size();

   }

because the command works on every second attempt it looks like their is an issue with flushing the batch or committing. Any suggestions? Thanks