Delphi 2.0: Multi-User Paradox Table updating problem.... 
Author Message
 Delphi 2.0: Multi-User Paradox Table updating problem....

I've probably missed the answer to this in the past, but we weren't
far enough along to be paying attention to it then!  So  be kind...

Our application consistently overwrites one person's recor with
another when accessing tables (Paradox) over a network..
The sequence of events as far as I've found are as follows:

User 1: Enters a new 'visit' record into the database, this is
followed by several records all relating to 'visit'..  As visit is
written, a field from a simple table, say 'counter', is read to
retrieve a key value which is incremented so the next 'visit' uses a
new key, etc..  (a manually incremented incremental field).. The new
'counter' value is written, as is the 'visit information with the
count from 'counter' as the key..

User 2:  Has been in the program, and now is going to add a 'visit'..
Only for some reason, the value obtained for the visit key (from
'counter') is not up to date with User 1's newly incremented value,
even after a table Refresh of 'counter'), and thus the new visit
overwrites User 1's 'visit'..

What would cause 'counter' not to be updated correctly beween users?
As far as I can tell they should be syncronized, and everything should
work just fine, but they don't..  One copy of the program had no
knowledge of theother..  Then there is data corruption, and loss..

What's up?  Any ideas?

I remember reading a bit about the paths to the .NET files needing to
be the same.. well they are except for the drive letter?  Is this ok?
I though that only had to do with some sort of 'multiple .NET files
message..'...

I'd really appreciate ANY help, suggestions, ideas, etc...!  I'm
running out of my own!

Thanks in advance,
-Tim Gary
 Carbon Based Corporation



Sun, 29 Nov 1998 03:00:00 GMT  
 Delphi 2.0: Multi-User Paradox Table updating problem....

Flush the BDE cache quickly by using DbiSaveChanges(TTable.Handle) to
write out the counter value everytime.
Also when setting the counter fields place the counter table in Edit mode,
before reading the value.

Doing this may not solve the problem but it may help.

Also look for the thread entitled BDE ATE MY DATA etc or LOSING
PARADOX/DBASE data in this newsgroup. The former may have expired.



Sun, 29 Nov 1998 03:00:00 GMT  
 Delphi 2.0: Multi-User Paradox Table updating problem....

I've allows just used two TTables.  One for the insert and the second
to go teo the last record and look up the new value.  I do this on a
after insert.  Now for a network inverment do a refresh on the second
table before getting the new value

example    the if for an afterinsert or a onnewrecord event for Table1

Table2.Refresh;
Table2.Last;
Table1KeyValue.Value:=Table2KeyValue.Value+1;

I've done this for many apps on and off of networks.  I've never had a
problem.  Anything you can is add the following lines to the above is
the new value is been updated.

Table1.Post;
Table1.Edit;

The only problem with this is a Table1.Cancel will not delete the
record and you will have to do it manualy.  And you will have to set
some var so that you now that its a new record.

                        Have fun,
                                <Blaine>



Sun, 29 Nov 1998 03:00:00 GMT  
 Delphi 2.0: Multi-User Paradox Table updating problem....


writes:

Quote:

>I've probably missed the answer to this in the past, but we weren't
>far enough along to be paying attention to it then!  So  be kind...

>Our application consistently overwrites one person's recor with
>another when accessing tables (Paradox) over a network..
>The sequence of events as far as I've found are as follows:

>User 1: Enters a new 'visit' record into the database, this is
>followed by several records all relating to 'visit'..  As visit is
>written, a field from a simple table, say 'counter', is read to
>retrieve a key value which is incremented so the next 'visit' uses a
>new key, etc..  (a manually incremented incremental field).. The new
>'counter' value is written, as is the 'visit information with the
>count from 'counter' as the key..

>User 2:  Has been in the program, and now is going to add a 'visit'..
>Only for some reason, the value obtained for the visit key (from
>'counter') is not up to date with User 1's newly incremented value,
>even after a table Refresh of 'counter'), and thus the new visit
>overwrites User 1's 'visit'..

>What would cause 'counter' not to be updated correctly beween users?
>As far as I can tell they should be syncronized, and everything should
>work just fine, but they don't..  One copy of the program had no
>knowledge of theother..  Then there is data corruption, and loss..

>What's up?  Any ideas?

>I remember reading a bit about the paths to the .NET files needing to
>be the same.. well they are except for the drive letter?  Is this ok?
>I though that only had to do with some sort of 'multiple .NET files
>message..'...

>I'd really appreciate ANY help, suggestions, ideas, etc...!  I'm
>running out of my own!

>Thanks in advance,
>-Tim Gary
> Carbon Based Corporation

I find this situation very interesting.  As I see it there are many
variables to this affair.  First all when any user opens this
incremental file  it should be opened in edit mode.  That immediately
will lock the record.  While in edit mode get the number, increment the
number, post and close the table.  Not following the exact sequence
above can be a cause for the above problem.
There has been another issue about posted records remaining in VCache
and not flushed from the buffer for the other user.  This article is
not the place for this discussion.  However in your scenario if every
user will open and close the table as above the buffer should be
flushed regardless.  I would be very interested in helping you solve
this problem.  Please let me know if you are doing the steps described
above and if not, by doing so does it help the situation.  If not, I
still have many other suggestions.  You may EMail me with the results.

Ben
Arrow Software



Mon, 30 Nov 1998 03:00:00 GMT  
 Delphi 2.0: Multi-User Paradox Table updating problem....

Quote:
>>Our application consistently overwrites one person's recor with
>>another when accessing tables (Paradox) over a network..

...

I'm also very interested in the outcome of this as I will be installing shortly
a nearly complete mult-user Delphi 2.0 application using Paradox files on
Windows NT.  We will begin testing withing a few weeks and I'm looking for any
potential problems.  Please keep posting information here in the newsgroup.
Thanks so much.

Dave.
----
For "Dynamic Database Development" call ...
  David E. Cornelius, Cornelius Concepts, Portland, Oregon



Mon, 30 Nov 1998 03:00:00 GMT  
 Delphi 2.0: Multi-User Paradox Table updating problem....

Quote:

>I've probably missed the answer to this in the past, but we weren't
>far enough along to be paying attention to it then!  So  be kind...

>Our application consistently overwrites one person's recor with
>another when accessing tables (Paradox) over a network..
>The sequence of events as far as I've found are as follows:

>User 1: Enters a new 'visit' record into the database, this is
>followed by several records all relating to 'visit'..  As visit is
>written, a field from a simple table, say 'counter', is read to
>retrieve a key value which is incremented so the next 'visit' uses a
>new key, etc..  (a manually incremented incremental field).. The new
>'counter' value is written, as is the 'visit information with the
>count from 'counter' as the key..

>User 2:  Has been in the program, and now is going to add a 'visit'..
>Only for some reason, the value obtained for the visit key (from
>'counter') is not up to date with User 1's newly incremented value,
>even after a table Refresh of 'counter'), and thus the new visit
>overwrites User 1's 'visit'..

>What would cause 'counter' not to be updated correctly beween users?
>As far as I can tell they should be syncronized, and everything should
>work just fine, but they don't..  One copy of the program had no
>knowledge of theother..  Then there is data corruption, and loss..

>What's up?  Any ideas?

>I remember reading a bit about the paths to the .NET files needing to
>be the same.. well they are except for the drive letter?  Is this ok?
>I though that only had to do with some sort of 'multiple .NET files
>message..'...

>I'd really appreciate ANY help, suggestions, ideas, etc...!  I'm
>running out of my own!

>Thanks in advance,
>-Tim Gary
> Carbon Based Corporation

I had a similar problem with my setup.  I tried two approaches which
between them solved the problem.

1.  On the computer holding the data set Local Shared (BDE
Configuration, system page) to true.  This should solve the problem if
one of the computers accessing the data is also holding it.

2.  Set Application.OnIdle time to a routine including the command
  DBIUseIdleTime;  This will flush the buffers to disk whenever the
processor has free time.  This is a good idea for any database
application as otherwise data can remain in the cache for hours and
then be lost if the computer crashes for any reason.

Sean



Tue, 01 Dec 1998 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Multi-user Paradox tables problem

2. Multi-user access to Paradox tables in Delphi 1.02

3. Delphi 2.0 Update - Problems with the new BDE that comes with the update

4. Multi-User access to Paradox Tables.

5. Multi User Applocation with Paradox tables.

6. Paradox Tables in CD-ROM with multi-users

7. Help! Sharing Paradox tables in multi-user system

8. Paradox tables in multi user enviorment?

9. Detect Multi-user on Paradox Table

10. Paradox tables and multi-users

11. Q: Concurrency problems with multi user PARADOX apps ??

12. Problem with multi-user table

 

 
Powered by phpBB® Forum Software