Duplicate entries in database

Hi, I have a process model where we are doing write to data store twice. First is insert and other should be update on same record. We have a primary key ID which is primary key and set to auto increment. First insert has ID as 1 and other insert Id gets incremented to 2 so 2 entries are coming. Is this because whenever we hit the database 'ID' will get incremented as it is set to auto increment? Should I set it to not be auto incremented? Or is there a way to update the same record and ID should have value as 1 only for second entry in db?

  Discussion posts and replies are publicly visible