geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Hogstrom <m...@hogstrom.org>
Subject Re: Pessimistic locking strategy for CMP beans in 1.1.1
Date Mon, 31 Jul 2006 14:38:15 GMT
Perhaps one additional element in the optimistic section like:

   <concurrency-control>[DATABASE | CONTAINER]</concurrency-control>



Dain Sundstrom wrote:
> +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