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.

How to handle Concurrency, need some Example

3 posts in DataWindow Last posting was on 2009-12-28 11:06:06.0Z
Jenny Posted on 2009-12-22 12:47:20.0Z
Sender: 12e4.4b30bfa9.1804289383@sybase.com
From: Jenny
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: How to handle Concurrency, need some Example
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4b30bfd8.12e9.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 22 Dec 2009 04:47:20 -0800
X-Trace: forums-1-dub 1261486040 10.22.241.41 (22 Dec 2009 04:47:20 -0800)
X-Original-Trace: 22 Dec 2009 04:47:20 -0800, 10.22.241.41
Lines: 12
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90475
Article PK: 410079

Hi All
New to PowerBuilder, PB 11
Anyone have any data Concurrency Example? Please share
with me .
I want a window (datawindow ) is open at multiple user and
how I can avoid data Concurrency ?
I can do with taking proper update property , can any one
share any working example with me .
I will appreciate help.

Thanks,
Jenny


"Paul Horan[Sybase]" <phoran_remove Posted on 2009-12-22 13:03:44.0Z
From: "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4b30bfd8.12e9.1681692777@sybase.com>
Subject: Re: How to handle Concurrency, need some Example
Lines: 53
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b30c3b0$1@forums-1-dub>
Date: 22 Dec 2009 05:03:44 -0800
X-Trace: forums-1-dub 1261487024 10.22.241.152 (22 Dec 2009 05:03:44 -0800)
X-Original-Trace: 22 Dec 2009 05:03:44 -0800, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90476
Article PK: 410081

PB uses "optimistic" concurrency - meaning that it assumes updates will
succeed, and deals with the failure if it happens. Pessimistic concurrency
attempts to "lock" the row upon retrieval and prevent clashes in the first
place. Easier to code, but your app performance really suffers.


Two users, A and B, each retrieve the row for customer 123 (John Doe) from
the database. User A attempts to change the first name to "Joe", and User B
attempts to change the first name to "Jane". Both click Save at the same
time, but user A gets there a fraction of a second ahead.

Here's how PB works:
If you set the Update properties (Rows > Update Properties > Where clause
for Update/Delete) to Key Columns:
User B's update will block until User A's commits. Both user's updates will
succeed. User A's update will immediately be overwritten by User B's, but
neither realize this until they re-retrieve the row.

If the Update properties are Key and Updateable columns:
User A's update will succeed. User B will get the message "Row changed
between retrieve and update" because her WHERE clause will include the
phrase "custID = 123 AND first_name = 'John'", which will return 0 rows.
User B's update attempt will fail no matter which column they change,
because there are no rows that satisfy the WHERE clause that PB will
generate.

If the Update properties are Key and Modified Columns:
User A's update will succeed. User B's update will fail for the same reason
as above. However, if User B had attempted to change a different column -
last name, for example, then both would succeed, because their individual
WHERE clauses will only contain references to the columns they are
attempting to change. Neither would be aware of the other's change until
they re-retrieve the row.

--
Paul Horan[Sybase]
http://blogs.sybase.com/phoran/

<Jenny> wrote in message news:4b30bfd8.12e9.1681692777@sybase.com...
> Hi All
> New to PowerBuilder, PB 11
> Anyone have any data Concurrency Example? Please share
> with me .
> I want a window (datawindow ) is open at multiple user and
> how I can avoid data Concurrency ?
> I can do with taking proper update property , can any one
> share any working example with me .
> I will appreciate help.
>
> Thanks,
> Jenny


Jenny Posted on 2009-12-28 11:06:06.0Z
Sender: 15d8.4b389062.1804289383@sybase.com
From: Jenny
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: How to handle Concurrency, need some Example
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4b38911e.15fa.1681692777@sybase.com>
References: <4b30c3b0$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 28 Dec 2009 03:06:06 -0800
X-Trace: forums-1-dub 1261998366 10.22.241.41 (28 Dec 2009 03:06:06 -0800)
X-Original-Trace: 28 Dec 2009 03:06:06 -0800, 10.22.241.41
Lines: 68
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90491
Article PK: 410095

Thanks,
Do you or Anyone have small example to demonstrate
datawinodw Concurrency handling, I am new to PB, so need one
small example



Any one have small example to demonstrate

> PB uses "optimistic" concurrency - meaning that it assumes
> updates will succeed, and deals with the failure if it
> happens. Pessimistic concurrency attempts to "lock" the
> row upon retrieval and prevent clashes in the first
> place. Easier to code, but your app performance really
> suffers.
>
>
> Two users, A and B, each retrieve the row for customer 123
> (John Doe) from the database. User A attempts to change
> the first name to "Joe", and User B attempts to change
> the first name to "Jane". Both click Save at the same
> time, but user A gets there a fraction of a second ahead.
>
> Here's how PB works:
> If you set the Update properties (Rows > Update Properties
> > Where clause for Update/Delete) to Key Columns:
> User B's update will block until User A's commits. Both
> user's updates will succeed. User A's update will
> immediately be overwritten by User B's, but neither
> realize this until they re-retrieve the row.
>
> If the Update properties are Key and Updateable columns:
> User A's update will succeed. User B will get the message
> "Row changed between retrieve and update" because her
> WHERE clause will include the phrase "custID = 123 AND
> first_name = 'John'", which will return 0 rows. User B's
> update attempt will fail no matter which column they
> change, because there are no rows that satisfy the WHERE
> clause that PB will generate.
>
> If the Update properties are Key and Modified Columns:
> User A's update will succeed. User B's update will fail
> for the same reason as above. However, if User B had
> attempted to change a different column - last name, for
> example, then both would succeed, because their individual
> WHERE clauses will only contain references to the columns
> they are attempting to change. Neither would be aware of
> the other's change until they re-retrieve the row.
>
> --
> Paul Horan[Sybase]
> http://blogs.sybase.com/phoran/
>
> <Jenny> wrote in message
> > news:4b30bfd8.12e9.1681692777@sybase.com... Hi All
> > New to PowerBuilder, PB 11
> > Anyone have any data Concurrency Example? Please share
> > with me .
> > I want a window (datawindow ) is open at multiple user
> > and how I can avoid data Concurrency ?
> > I can do with taking proper update property , can any
> > one share any working example with me .
> > I will appreciate help.
> >
> > Thanks,
> > Jenny
>
>