Jeff,

On 18. 3. 2016, at 17:42, Jeff Schmitz <jeffschm...@icloud.com> wrote:

> ... I’ve got some lock trimming to do.

Depending on your application logic, you might get away with locking primary 
keys only, nothing else. I have got one application where it so happens nobody 
cares of possible clashes, the desired logic is that the latest writer wins; I 
am locking primary keys only in its model, and it runs without any problem (at 
least, any I know of ;)) for years.

Note also, with some databases it might get a bit hairy locking timestamps -- 
sometimes, they might slightly change just by storing in the DB. And of course, 
you (almost) never want to lock BLOBs.

All the best,
OC 


> 
>> On Mar 18, 2016, at 11:11 AM, Chuck Hill <ch...@gevityinc.com> wrote:
>> 
>> Hi Jeff,
>> 
>> Yes, if a column is not marked as locking, then it won’t appear in the WHERE 
>> clause.
>> 
>> The danger is that you might save changes that are inconsistent with what 
>> the database has stored in the columns that you are not locking on.  As a 
>> contrived example, consider the update below changing Bob to Robert.  If you 
>> don’t lock on first and last name, some other process might have updated 
>> both names to John Edwards.  Your update will now change the name to Robert 
>> Edwards.  You need to look at your data and see where that might matter and 
>> where it does not.
>> 
>> Chuck
>> 
>> 
>> From: <webobjects-dev-bounces+chill=gevityinc....@lists.apple.com> on behalf 
>> of Jeff Schmitz <jeffschm...@icloud.com>
>> Date: Thursday, March 17, 2016 at 5:20 PM
>> To: WebObjects Development <webobjects-dev@lists.apple.com>
>> Subject: Quick EOModel Column Locking ?
>> 
>> I’m starting to get some optimistic column locking failures during 
>> background db processing soI’m trying to grasp conditions under which I 
>> don’t need to lock a column (i.e. put the little lock symbol in EOModeler) 
>> 
>> If I have a column in a table that I know is not updated (i.e. changed) by 
>> any client except form my personal administrative page, can I get away 
>> without locking that column?    On unlocked columns is there any where 
>> clause checks such as shown below before that column is updated?  If not, 
>> this should stop the locking errors, right?  Any other dangers with this?
>> 
>> update Person set FirstName = 'Robert' where PersonID = 123 and FirstName = 
>> 'Bob' and LastName = 'Roberts'
>> Finally, to make this change Is it as simple as unchecking the column and 
>> redeploying my EOModel file?
>> 
>> Thanks!
>> Jeff
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/ocs%40ocs.cz
> 
> This email sent to o...@ocs.cz


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to