Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

big problem with savechanges()

1 view
Skip to first unread message

Paolo Proni

unread,
Nov 17, 1999, 3:00:00 AM11/17/99
to
Hello,
I have noticed that when I save my queryDataSet with savechanges, JB3
saves only the updated fields.
In my application I REALLY need to save even the not update fields in
order to overwrite the data in the database if someone already changed
them.
I use a queryResolver in which I only set KEY_COLUMN_ONLY because I need
not to search the potentially updated fields on the server.

What can I do?
Paolo


John B. Moore

unread,
Nov 18, 1999, 3:00:00 AM11/18/99
to

Your request is very unusual..<G> I would start by looking up a
method something like "resetPending...??"

Question, why would you want to overwrite changes made by someone
else??? If they do the same to you, then nothing will ever change in your
database.

John...

+++++++++++++++++++++++
TeamB are volunteer helpers. Please do not email replies or questions.
Post or reply only on this newsgroup. Thank you.
=======================


Paolo Proni

unread,
Nov 18, 1999, 3:00:00 AM11/18/99
to
That's what I was asked to implement:
if my application recognize that another user changed some data (I would do it
by a last_user field in the db), it shows a message to ask if the user wants
to overwrite.
This behaviour is left to the user, not to the programmer.
If a boss wants to overwrite data changed by a dependant, he should do it
easily, don't you think so?
BTW, what have I to do with resetPending?
Thank you John!
Paolo

Wido Riezebos

unread,
Nov 19, 1999, 3:00:00 AM11/19/99
to
If you have a record level constraint that is not implemented on the server,
NOT saving ALL your columns could easily violate that constraint. This is a
legitimate reason to save all your columns OR to use locking code that uses
the old field values to find the original record. The quick and easy way is
to overwrite all columns

Wido

--
==========================================================================
WTJ. Riezebos, w.rie...@genimen.com
Genimen BV, www.genimen.com
==========================================================================
John B. Moore (TeamB) <71333...@compuserve.com> wrote in message
news:VA.000006e...@microps-215.microps.com...

John B. Moore

unread,
Nov 19, 1999, 3:00:00 AM11/19/99
to
In article <38346BAB...@mbox.pnet.it>, Paolo Proni wrote:
> If a boss wants to overwrite data changed by a dependant, he should do it
> easily, don't you think so?

Sure, no problem. You just have to realize that it is SO unusual that
the tools don't directly support this idea. But of course with a lot of
programming, you can do anything..<G>

> BTW, what have I to do with resetPending?

Look it up.. There are a number of methods for reseting the Pending
Status in DataExpress. It is these methods that you will need to do what
you want.. I'll look'm up for you, but I don't have time right now..

John..

John B. Moore

unread,
Nov 20, 1999, 3:00:00 AM11/20/99
to
In article <813lup$pl...@forums.borland.com>, Wido Riezebos wrote:
> If you have a record level constraint that is not implemented on the server,
> NOT saving ALL your columns could easily violate that constraint. This is a
> legitimate reason to save all your columns OR to use locking code that uses
> the old field values to find the original record. The quick and easy way is
> to overwrite all columns

I did not interpret his question that way.. I took it to mean he wanted
tos save all rows.. maybe I have missunderstood the question..

Paolo Proni

unread,
Nov 21, 1999, 3:00:00 AM11/21/99
to
I really was speaking about columns, not rows.
Let me explain better: suppose to have 10 columns in a record.
The user "Paolo" modify the value of 2 of theese colomns and save.
DataExpress save only the 2 updated columns, leaving the other untouched.
So if someone else has modified the other 8 columns before Paolo's save, the save
action will not overwrite the other 8 fields, but only the 2.
The result is a mix of the two saves and my boss asked me to let the latest save
to overwrite everything.
Please help me
Paolo

John B. Moore

unread,
Nov 22, 1999, 3:00:00 AM11/22/99
to

Well, I completely misunderstood you, my apologies..

I can suggest two workarounds.. and I will see if I can get this in as a
suggestion to control this behavior. Right now the behavior is to resolve only
those columns that have changed. My guess is that is saves bandwidth and therefore
keeps the performance up.. (something folks are always complaining about as
well..<G>)

1) As suggested by someone already, upon departing the record touch each field
by overwriting the same value..etc..

2) Create a custom resolver...

One thing is curious, the normal resolver behavior is to throw an error whenever
the target record has changed in any way. You are not seeing this..??? Normally
this would then trigger the UpdateError event and allow you to handle this issue
there.

Paolo Proni

unread,
Nov 22, 1999, 3:00:00 AM11/22/99
to
Changing the value of the other fields with their own values is unuseful because it
seems that JB always compares the new value with the old...
Writing a new Resolver seems too complicated, that's way I would like to find a much
productive and easy way...
If we cannot, I really would like that Borland would update this "feature" in the next
(very wanted) fix...

Paolo

John B. Moore

unread,
Nov 23, 1999, 3:00:00 AM11/23/99
to

The "fix" is in the resolver.. the default resolver is what is not doing what you
want.. It's not that complicated. I will though pass your request on (don't hold your
breath on a "fix" for this version since you are the only person I'm aware of that has
requested this "feature"), but in the mean time check out my web site at www.microps.com
and select the "Papers, FAQ.." page and there is a paper I did for last years conference
on building resolvers. It's all laid out for you, paint by numbers..<G>

Paolo Proni

unread,
Nov 24, 1999, 3:00:00 AM11/24/99
to
Thank you very much, John!
I printed your article and I will study soon!
Please, if you have contact with Borland, tell them that the "smart" saving of only
different value fields may cause some troubles in a multi user environement, so it would be
nice to let the programmer change this behaviour easily (for instance: setting a boolean
property "smartSaving").
I think I will try to write my own resolver to DB2, but I had a look to the Borland code for
the default resolver and it seems very difficult to do... Considering that even my
application is hard to do for itself, sometimes it seems to me that I'm loosing too much
time for this basic features.
BTW thanks again and I hope you will help me again to find the solution !!!
Ciao.
Paolo

Powerbuilder

unread,
Dec 9, 1999, 3:00:00 AM12/9/99
to
Paolo Proni wrote in message <383C6485...@mbox.pnet.it>...
Hi, Paolo.

There's another workaround you can think of.

- Once you want to save the user who last modified something, how about
creating an extra table with the columns:

1. datetime stamp (suck it from the server, of course!)
2. user ID or user name
3. name of modified columns

(1 + 2 as the primary key)

So, everytime someone modifies and attempt to save it a new row in this new
table will be added and the datetimestamp, user id and columns will be saved
creating though, a kind of spool for a later investigation or whatever...

I guess ir helps!

Regards,

Gilberto Beltrao

0 new messages