Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

About concurrency in updates

2 posts in General Discussion (Chinese) Last posting was on 2007-05-25 15:12:27.0Z
Melvyn Polatchek Posted on 2007-03-26 22:01:41.0Z
Sender: 5431.46084076.846930886@sybase.com
From: Melvyn Polatchek
Newsgroups: sybase.public.chinese.powerbuilder.general
Subject: About concurrency in updates
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <460842c5.5468.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 26 Mar 2007 14:01:41 -0800
X-Trace: forums-1-dub 1174946501 10.22.241.41 (26 Mar 2007 14:01:41 -0800)
X-Original-Trace: 26 Mar 2007 14:01:41 -0800, 10.22.241.41
Lines: 13
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:211
Article PK: 104236

This is a rather elementary topic and yet I realize I have
never quite understood it. In the datawindow update
properties dialog box, the choices for "Where Clause for
update/delete" are:
Key Columns, Key and updateable columns, Key and modified
columns. Which allows the greatest concurrency and why. It
seems to me if we only use key columns and a non-key
updateable columns is changed, the change will be lost
because it won't update. Why is that preferable to the
possibility of overwriting another users change. One user
still loses.

Melvyn Polatchek


Beatriz Martins Posted on 2007-05-25 15:12:27.0Z
From: "Beatriz Martins" <beatriz@pred.com.br>
Newsgroups: sybase.public.chinese.powerbuilder.general
References: <460842c5.5468.1681692777@sybase.com>
Subject: Re: About concurrency in updates
Lines: 67
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896
NNTP-Posting-Host: 201.79.106.143
X-Original-NNTP-Posting-Host: 201.79.106.143
Message-ID: <4656fcdb$1@forums-1-dub>
Date: 25 May 2007 08:12:27 -0700
X-Trace: forums-1-dub 1180105947 201.79.106.143 (25 May 2007 08:12:27 -0700)
X-Original-Trace: 25 May 2007 08:12:27 -0700, 201.79.106.143
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:237
Article PK: 104265

The diference is on the way PB create the where clause for the update
select.

Ex:

This is the dw select:

SELECT mytabledata.id, mytabledata.name
FROM mytabledata;

You change some names in some pc in your network and someone else change
others names and some the same you change:

If you choose only keys, the update will be done for both user and the first
will see wrong data.

The update for you is

UPDATE mytabledata.name = 'new name1'
WHERE mytabledata.id = 1;

UPDATE mytabledata.name = 'new name2'
WHERE mytabledata.id = 2;

The update for other user is

UPDATE mytabledata.name = 'other new name2'
WHERE mytabledata.id = 2;

UPDATE mytabledata.name = 'new name3'
WHERE mytabledata.id = 3;

The result is that one of you will be see diferent data in the screen and
the one who update first are viewing wrong data for name of id = 2.

Besides if you choose some other of the 2 other options of update the user
that update at end will receve a db message inviting to an other retrieve
becouse the data was changed beween retieve and update.

See the update that the original name no more exists in db.

UPDATE mytabledata.name = 'other new name2'
WHERE mytabledata.id = 2 and
mytabledata.name = 'original name';

Hope this help.

Regards
BMartins (Brasil)

<Melvyn Polatchek> escreveu na mensagem
news:460842c5.5468.1681692777@sybase.com...

> This is a rather elementary topic and yet I realize I have
> never quite understood it. In the datawindow update
> properties dialog box, the choices for "Where Clause for
> update/delete" are:
> Key Columns, Key and updateable columns, Key and modified
> columns. Which allows the greatest concurrency and why. It
> seems to me if we only use key columns and a non-key
> updateable columns is changed, the change will be lost
> because it won't update. Why is that preferable to the
> possibility of overwriting another users change. One user
> still loses.
>
> Melvyn Polatchek