geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Re: Pessimistic locking strategy for CMP beans in 1.1.1
Date Sun, 30 Jul 2006 18:04:03 GMT
+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

Mime
View raw message