+1 looks good

On Jul 26, 2006, at 7:47 PM, Matt Hogstrom wrote:

          <locking-strategy>
              <optimistic-locking>
                <optimistic-column>occColumn</optimistic-column>
                <optimistic-type>TIMESTAMP</optimistic-type>
          </locking-strategy>

one comment... this xml implies that the database is handling the auto increment/update of the optimistic lock column. I have seen schemas that assume that the application code will be handling this, with some sql like this:

UPDATE foo
SET value = newValue, ver = 5
WHERE pk = myPk AND ver = 4

If the database is auto updating the row, you will need to reread the column after any update, so if you make another update in the same transaction, you can assure you know the current value of the optimistic column.

-dain

Reply via email to