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.

GetChanges/SetChanges and Status Flags

6 posts in General Discussion (old) Last posting was on 2000-02-18 15:21:00.0Z
Donovan Posted on 2000-02-17 19:23:17.0Z
Newsgroups: sybase.public.easerver
From: "Donovan" <dono@ix.netscom.com>
Subject: GetChanges/SetChanges and Status Flags
Date: Thu, 17 Feb 2000 13:23:17 -0600
Lines: 52
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: pool-209-138-214-210.dlls.grid.net 209.138.214.210
Message-ID: <347_Fsy1sxXe$GA.184@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28470
Article PK: 160627

Hi,

I need some confirmation here to make sure I'm not crazy. Suppose I have a
middle-tier datastore (call it inv_ds) and a PowerBuilder client datawindow
(dw_1). After retrieving the datastore, I follow these well known steps:

1. inv_ds.GetFullState() => dw_1.SetFullState()
2. User makes a single change
3. User applies change which causes...
4. dw_1.GetChanges() => inv_ds.SetChanges()
5. inv_ds.Update(False, False) // Other datastore are updated as well
6. inv_ds.ResetUpdate() // manually done if all other datastores are
updated and commited properly in this logical unit of work.
7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges = 1, I
think meaning that the status flag has changed]
8. dw_1 Status Flags = ModCount: 0, DeleteCount: 0

Cool. Now try the same thing but leave out the Update() function:

1. inv_ds.GetFullState() => dw_1.SetFullState()
2. User makes a change
3. User applies change which causes...
4. dw_1.GetChanges() => inv_ds.SetChanges()
5. Take the data in inv_ds and use it to do other work--no Update is sent
to the database for _this_ datastore.
6. inv_ds.ResetUpdate() // Want to reset the status because the
presentation needs to know there are no outstanding changes...
7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges = 0, I
think meaning that PB thinks no changes have been made to the datastore]
8. dw_1 Status Flags = ModCount: 1, DeleteCount: 0

At this point, my presentation datawindow still thinks changes have been
made, but not sent to the middle-tier. And this causes the window to prompt
the user to save changes upon closing.

Is there something magical with the Update function that causes GetChanges()
to understand that it needs to send back the new status flags? Note that in
both cases, I _manually_ reset the status flags. The Update function never
does it. Is there any way I can get the status flags back to the client if
I don't want to update the datastore? I really don't want the client side
to have to understand which object's data are physically sent to the
database and which aren't. That is, I don't want to have to manually reset
the status flag on the client side.

Can someone confirm these two scenarios?

Any thoughts would be appreciated,

Donovan


Andrew Hircock Posted on 2000-02-18 14:30:09.0Z
Newsgroups: sybase.public.easerver
Date: Fri, 18 Feb 2000 09:30:09 -0500
From: Andrew Hircock <ahircock@mxi.com>
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: GetChanges/SetChanges and Status Flags
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 78
NNTP-Posting-Host: jupiter.mxi.com 209.87.228.68
Message-ID: <347_38AD5771.C3FE3999@mxi.com>
References: <347_Fsy1sxXe$GA.184@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28397
Article PK: 160420

Hi Donovan,

I've noticed something similar. The way that we solved it is: in step 7. instead
of using GetChanges/SetChanges, use the original GetFullState/SetFullState
again. It also helped us out because the server component doesn't need both a
"GetFullState" and a "GetChanges" function... you will only need a
"GetFullState" function.

The downside to this approach is that GetFullState/SetFullState WILL NOT WORK if
there are any modified columns in the datastore. I should qualify that... in
about 5% of the cases GetFullState/SetFullState will not work (causes out of
memory errors, or lost modified flags, etc.)

Donovan wrote:

> Hi,
>
> I need some confirmation here to make sure I'm not crazy. Suppose I have a
> middle-tier datastore (call it inv_ds) and a PowerBuilder client datawindow
> (dw_1). After retrieving the datastore, I follow these well known steps:
>
> 1. inv_ds.GetFullState() => dw_1.SetFullState()
> 2. User makes a single change
> 3. User applies change which causes...
> 4. dw_1.GetChanges() => inv_ds.SetChanges()
> 5. inv_ds.Update(False, False) // Other datastore are updated as well
> 6. inv_ds.ResetUpdate() // manually done if all other datastores are
> updated and commited properly in this logical unit of work.
> 7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges = 1, I
> think meaning that the status flag has changed]
> 8. dw_1 Status Flags = ModCount: 0, DeleteCount: 0
>
> Cool. Now try the same thing but leave out the Update() function:
>
> 1. inv_ds.GetFullState() => dw_1.SetFullState()
> 2. User makes a change
> 3. User applies change which causes...
> 4. dw_1.GetChanges() => inv_ds.SetChanges()
> 5. Take the data in inv_ds and use it to do other work--no Update is sent
> to the database for _this_ datastore.
> 6. inv_ds.ResetUpdate() // Want to reset the status because the
> presentation needs to know there are no outstanding changes...
> 7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges = 0, I
> think meaning that PB thinks no changes have been made to the datastore]
> 8. dw_1 Status Flags = ModCount: 1, DeleteCount: 0
>
> At this point, my presentation datawindow still thinks changes have been
> made, but not sent to the middle-tier. And this causes the window to prompt
> the user to save changes upon closing.
>
> Is there something magical with the Update function that causes GetChanges()
> to understand that it needs to send back the new status flags? Note that in
> both cases, I _manually_ reset the status flags. The Update function never
> does it. Is there any way I can get the status flags back to the client if
> I don't want to update the datastore? I really don't want the client side
> to have to understand which object's data are physically sent to the
> database and which aren't. That is, I don't want to have to manually reset
> the status flag on the client side.
>
> Can someone confirm these two scenarios?
>
> Any thoughts would be appreciated,
>
> Donovan


Francois Chamberland Posted on 2000-02-18 14:45:18.0Z
Newsgroups: sybase.public.easerver
From: "Francois Chamberland" <francoischamberland@apg.com>
Subject: Re: GetChanges/SetChanges and Status Flags
Date: Fri, 18 Feb 2000 09:45:18 -0500
Lines: 93
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
NNTP-Posting-Host: gateway.vote.elections.ca 198.103.171.2
Message-ID: <347_UdZcT8he$GA.184@forums.sybase.com>
References: <347_Fsy1sxXe$GA.184@forums.sybase.com> <347_38AD5771.C3FE3999@mxi.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28392
Article PK: 160416

Hi,

Have you tried to do a dw.reset() before applying the fullstate again?

It fixed the problem for me.

Francois

Andrew Hircock wrote in message <38AD5771.C3FE3999@mxi.com>...
>Hi Donovan,
>
>I've noticed something similar. The way that we solved it is: in step 7.
instead
>of using GetChanges/SetChanges, use the original GetFullState/SetFullState
>again. It also helped us out because the server component doesn't need both
a
>"GetFullState" and a "GetChanges" function... you will only need a
>"GetFullState" function.
>
>The downside to this approach is that GetFullState/SetFullState WILL NOT
WORK if
>there are any modified columns in the datastore. I should qualify that...
in
>about 5% of the cases GetFullState/SetFullState will not work (causes out
of
>memory errors, or lost modified flags, etc.)
>
>Donovan wrote:
>
>> Hi,
>>
>> I need some confirmation here to make sure I'm not crazy. Suppose I have
a
>> middle-tier datastore (call it inv_ds) and a PowerBuilder client
datawindow
>> (dw_1). After retrieving the datastore, I follow these well known steps:
>>
>> 1. inv_ds.GetFullState() => dw_1.SetFullState()
>> 2. User makes a single change
>> 3. User applies change which causes...
>> 4. dw_1.GetChanges() => inv_ds.SetChanges()
>> 5. inv_ds.Update(False, False) // Other datastore are updated as well
>> 6. inv_ds.ResetUpdate() // manually done if all other datastores are
>> updated and commited properly in this logical unit of work.
>> 7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges = 1,
I
>> think meaning that the status flag has changed]
>> 8. dw_1 Status Flags = ModCount: 0, DeleteCount: 0
>>
>> Cool. Now try the same thing but leave out the Update() function:
>>
>> 1. inv_ds.GetFullState() => dw_1.SetFullState()
>> 2. User makes a change
>> 3. User applies change which causes...
>> 4. dw_1.GetChanges() => inv_ds.SetChanges()
>> 5. Take the data in inv_ds and use it to do other work--no Update is
sent
>> to the database for _this_ datastore.
>> 6. inv_ds.ResetUpdate() // Want to reset the status because the
>> presentation needs to know there are no outstanding changes...
>> 7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges = 0,
I
>> think meaning that PB thinks no changes have been made to the datastore]
>> 8. dw_1 Status Flags = ModCount: 1, DeleteCount: 0
>>
>> At this point, my presentation datawindow still thinks changes have been
>> made, but not sent to the middle-tier. And this causes the window to
prompt
>> the user to save changes upon closing.
>>
>> Is there something magical with the Update function that causes
GetChanges()
>> to understand that it needs to send back the new status flags? Note that
in
>> both cases, I _manually_ reset the status flags. The Update function
never
>> does it. Is there any way I can get the status flags back to the client
if
>> I don't want to update the datastore? I really don't want the client
side
>> to have to understand which object's data are physically sent to the
>> database and which aren't. That is, I don't want to have to manually
reset
>> the status flag on the client side.
>>
>> Can someone confirm these two scenarios?
>>
>> Any thoughts would be appreciated,
>>
>> Donovan
>


Andrew Hircock Posted on 2000-02-18 15:21:00.0Z
Newsgroups: sybase.public.easerver
Date: Fri, 18 Feb 2000 10:21:00 -0500
From: Andrew Hircock <ahircock@mxi.com>
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: GetChanges/SetChanges and Status Flags
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 99
NNTP-Posting-Host: jupiter.mxi.com 209.87.228.68
Message-ID: <347_38AD635C.6931E4E4@mxi.com>
References: <347_Fsy1sxXe$GA.184@forums.sybase.com> <347_38AD5771.C3FE3999@mxi.com> <347_UdZcT8he$GA.184@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28383
Article PK: 160408

Thanks Francois,

Thanks, I tried running dw.reset before applying the SetFullState function. But
it didn't help. I've discussed this problem with Sybase support (I was actually
talking to one of the developers), and they logged it as a bug. Apparently, it
is very unusual for a datastore to be modified before it gets passed to the
client using GetFullState/SetFullState.

Thanks

Francois Chamberland wrote:

> Hi,
>
> Have you tried to do a dw.reset() before applying the fullstate again?
>
> It fixed the problem for me.
>
> Francois
>
> Andrew Hircock wrote in message <38AD5771.C3FE3999@mxi.com>...
> >Hi Donovan,
> >
> >I've noticed something similar. The way that we solved it is: in step 7.
> instead
> >of using GetChanges/SetChanges, use the original GetFullState/SetFullState
> >again. It also helped us out because the server component doesn't need both
> a
> >"GetFullState" and a "GetChanges" function... you will only need a
> >"GetFullState" function.
> >
> >The downside to this approach is that GetFullState/SetFullState WILL NOT
> WORK if
> >there are any modified columns in the datastore. I should qualify that...
> in
> >about 5% of the cases GetFullState/SetFullState will not work (causes out
> of
> >memory errors, or lost modified flags, etc.)
> >
> >Donovan wrote:
> >
> >> Hi,
> >>
> >> I need some confirmation here to make sure I'm not crazy. Suppose I have
> a
> >> middle-tier datastore (call it inv_ds) and a PowerBuilder client
> datawindow
> >> (dw_1). After retrieving the datastore, I follow these well known steps:
> >>
> >> 1. inv_ds.GetFullState() => dw_1.SetFullState()
> >> 2. User makes a single change
> >> 3. User applies change which causes...
> >> 4. dw_1.GetChanges() => inv_ds.SetChanges()
> >> 5. inv_ds.Update(False, False) // Other datastore are updated as well
> >> 6. inv_ds.ResetUpdate() // manually done if all other datastores are
> >> updated and commited properly in this logical unit of work.
> >> 7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges = 1,
> I
> >> think meaning that the status flag has changed]
> >> 8. dw_1 Status Flags = ModCount: 0, DeleteCount: 0
> >>
> >> Cool. Now try the same thing but leave out the Update() function:
> >>
> >> 1. inv_ds.GetFullState() => dw_1.SetFullState()
> >> 2. User makes a change
> >> 3. User applies change which causes...
> >> 4. dw_1.GetChanges() => inv_ds.SetChanges()
> >> 5. Take the data in inv_ds and use it to do other work--no Update is
> sent
> >> to the database for _this_ datastore.
> >> 6. inv_ds.ResetUpdate() // Want to reset the status because the
> >> presentation needs to know there are no outstanding changes...
> >> 7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges = 0,
> I
> >> think meaning that PB thinks no changes have been made to the datastore]
> >> 8. dw_1 Status Flags = ModCount: 1, DeleteCount: 0
> >>
> >> At this point, my presentation datawindow still thinks changes have been
> >> made, but not sent to the middle-tier. And this causes the window to
> prompt
> >> the user to save changes upon closing.
> >>
> >> Is there something magical with the Update function that causes
> GetChanges()
> >> to understand that it needs to send back the new status flags? Note that
> in
> >> both cases, I _manually_ reset the status flags. The Update function
> never
> >> does it. Is there any way I can get the status flags back to the client
> if
> >> I don't want to update the datastore? I really don't want the client
> side
> >> to have to understand which object's data are physically sent to the
> >> database and which aren't. That is, I don't want to have to manually
> reset
> >> the status flag on the client side.
> >>
> >> Can someone confirm these two scenarios?
> >>
> >> Any thoughts would be appreciated,
> >>
> >> Donovan
> >


Donovan Posted on 2000-02-18 14:56:42.0Z
Newsgroups: sybase.public.easerver
From: "Donovan" <dono@ix.netscom.com>
Subject: Re: GetChanges/SetChanges and Status Flags
Date: Fri, 18 Feb 2000 08:56:42 -0600
Lines: 121
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: pool-207-205-236-165.dlls.grid.net 207.205.236.165
Message-ID: <347_4TbcZBie$GA.149@forums.sybase.com>
References: <347_Fsy1sxXe$GA.184@forums.sybase.com> <347_38AD5771.C3FE3999@mxi.com> <347_UdZcT8he$GA.184@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28388
Article PK: 160415

Thanks guys,

I'd hoped to avoid calling the xFullState functions, but this looks like
it's the only way around the problem. I'm sure there is a logical reason
for GetChanges working this way. In my mind it seems like changing the
status flags should count for a 'change'...

Appreciate the advice!

Dono.

"Francois Chamberland" <francoischamberland@apg.com> wrote in message
news:UdZcT8he$GA.184@forums.sybase.com...
> Hi,
>
> Have you tried to do a dw.reset() before applying the fullstate again?
>
> It fixed the problem for me.
>
> Francois
>
> Andrew Hircock wrote in message <38AD5771.C3FE3999@mxi.com>...
> >Hi Donovan,
> >
> >I've noticed something similar. The way that we solved it is: in step 7.
> instead
> >of using GetChanges/SetChanges, use the original
GetFullState/SetFullState
> >again. It also helped us out because the server component doesn't need
both
> a
> >"GetFullState" and a "GetChanges" function... you will only need a
> >"GetFullState" function.
> >
> >The downside to this approach is that GetFullState/SetFullState WILL NOT
> WORK if
> >there are any modified columns in the datastore. I should qualify that...
> in
> >about 5% of the cases GetFullState/SetFullState will not work (causes out
> of
> >memory errors, or lost modified flags, etc.)
> >
> >Donovan wrote:
> >
> >> Hi,
> >>
> >> I need some confirmation here to make sure I'm not crazy. Suppose I
have
> a
> >> middle-tier datastore (call it inv_ds) and a PowerBuilder client
> datawindow
> >> (dw_1). After retrieving the datastore, I follow these well known
steps:
> >>
> >> 1. inv_ds.GetFullState() => dw_1.SetFullState()
> >> 2. User makes a single change
> >> 3. User applies change which causes...
> >> 4. dw_1.GetChanges() => inv_ds.SetChanges()
> >> 5. inv_ds.Update(False, False) // Other datastore are updated as well
> >> 6. inv_ds.ResetUpdate() // manually done if all other datastores
are
> >> updated and commited properly in this logical unit of work.
> >> 7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges =
1,
> I
> >> think meaning that the status flag has changed]
> >> 8. dw_1 Status Flags = ModCount: 0, DeleteCount: 0
> >>
> >> Cool. Now try the same thing but leave out the Update() function:
> >>
> >> 1. inv_ds.GetFullState() => dw_1.SetFullState()
> >> 2. User makes a change
> >> 3. User applies change which causes...
> >> 4. dw_1.GetChanges() => inv_ds.SetChanges()
> >> 5. Take the data in inv_ds and use it to do other work--no Update is
> sent
> >> to the database for _this_ datastore.
> >> 6. inv_ds.ResetUpdate() // Want to reset the status because the
> >> presentation needs to know there are no outstanding changes...
> >> 7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges =
0,
> I
> >> think meaning that PB thinks no changes have been made to the
datastore]
> >> 8. dw_1 Status Flags = ModCount: 1, DeleteCount: 0
> >>
> >> At this point, my presentation datawindow still thinks changes have
been
> >> made, but not sent to the middle-tier. And this causes the window to
> prompt
> >> the user to save changes upon closing.
> >>
> >> Is there something magical with the Update function that causes
> GetChanges()
> >> to understand that it needs to send back the new status flags? Note
that
> in
> >> both cases, I _manually_ reset the status flags. The Update function
> never
> >> does it. Is there any way I can get the status flags back to the
client
> if
> >> I don't want to update the datastore? I really don't want the client
> side
> >> to have to understand which object's data are physically sent to the
> >> database and which aren't. That is, I don't want to have to manually
> reset
> >> the status flag on the client side.
> >>
> >> Can someone confirm these two scenarios?
> >>
> >> Any thoughts would be appreciated,
> >>
> >> Donovan
> >
>
>


Francois Chamberland Posted on 2000-02-18 13:29:12.0Z
Newsgroups: sybase.public.easerver
From: "Francois Chamberland" <francoischamberland@apg.com>
Subject: Re: GetChanges/SetChanges and Status Flags
Date: Fri, 18 Feb 2000 08:29:12 -0500
Lines: 74
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
NNTP-Posting-Host: gateway.vote.elections.ca 198.103.171.2
Message-ID: <347_JXcGyRhe$GA.184@forums.sybase.com>
References: <347_Fsy1sxXe$GA.184@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28403
Article PK: 160425

According to my experience, if you do not update and do a resetUpdate()
there is nothing left for inv_ds.GetChanges() to pick up, which is why
getChanges() returns 0.

But if you update and then do a resetUpdate() the getChanges() knows an
update occurred and it
returns some flags that tells the datawindow on your client to resetUpdate
itself.

getChanges() picks up something only if you properly updated your datastore
OR if some columns have
one of the "modified" status.

Francois

Donovan wrote in message ...
>Hi,
>
>I need some confirmation here to make sure I'm not crazy. Suppose I have a
>middle-tier datastore (call it inv_ds) and a PowerBuilder client datawindow
>(dw_1). After retrieving the datastore, I follow these well known steps:
>
>1. inv_ds.GetFullState() => dw_1.SetFullState()
>2. User makes a single change
>3. User applies change which causes...
>4. dw_1.GetChanges() => inv_ds.SetChanges()
>5. inv_ds.Update(False, False) // Other datastore are updated as well
>6. inv_ds.ResetUpdate() // manually done if all other datastores are
>updated and commited properly in this logical unit of work.
>7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges = 1, I
>think meaning that the status flag has changed]
>8. dw_1 Status Flags = ModCount: 0, DeleteCount: 0
>
>Cool. Now try the same thing but leave out the Update() function:
>
>1. inv_ds.GetFullState() => dw_1.SetFullState()
>2. User makes a change
>3. User applies change which causes...
>4. dw_1.GetChanges() => inv_ds.SetChanges()
>5. Take the data in inv_ds and use it to do other work--no Update is sent
>to the database for _this_ datastore.
>6. inv_ds.ResetUpdate() // Want to reset the status because the
>presentation needs to know there are no outstanding changes...
>7. inv_ds.GetChanges() => dw_1.SetChanges() [Status for GetChanges = 0, I
>think meaning that PB thinks no changes have been made to the datastore]
>8. dw_1 Status Flags = ModCount: 1, DeleteCount: 0
>
>At this point, my presentation datawindow still thinks changes have been
>made, but not sent to the middle-tier. And this causes the window to
prompt
>the user to save changes upon closing.
>
>Is there something magical with the Update function that causes
GetChanges()
>to understand that it needs to send back the new status flags? Note that
in
>both cases, I _manually_ reset the status flags. The Update function never
>does it. Is there any way I can get the status flags back to the client if
>I don't want to update the datastore? I really don't want the client side
>to have to understand which object's data are physically sent to the
>database and which aren't. That is, I don't want to have to manually reset
>the status flag on the client side.
>
>Can someone confirm these two scenarios?
>
>Any thoughts would be appreciated,
>
>Donovan
>
>
>