?
Solved

Data change notification in multi user environment

Posted on 1998-08-23
5
Medium Priority
?
368 Views
Last Modified: 2008-02-20
I am using Codebase as the database engine for a multi user (and single user) Windows application.  In a multi user system,  if two users have a data file open and a change is made by one user, how can I get notify the other running application on the other user's PC that a change has been made to the datafile.  I need this functionality to so that the screen/view can be updated to reflect the changes made by the other user.

ie: Windows explorer automatically updates window contents if an item (directory, shortcut etc..) is added to a directory via Network Neighbourhood  on a remote PC, the Windows Explorer screen will be automatically updated to
show this new item.  This is the functionality I am after.

I have (very) limited multi user programming experience so any help would be greatly appreciated.

0
Comment
Question by:Woodster
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
gmoriak earned 400 total points
ID: 1025558
You're going to have to "fake it".  You could have a timer execute a simple check to see if data has changed every 30 seconds etc.  If data has changed, you would then refresh all of your data.  You need to keep the check simple and fast and execute it as infrequently as possible so as not to degrade perfarmance.

Any more sophistacated solution would involve creating an n-tier application solution.  The above solution is generally a good enough simulation.  Explorer isn't immediate either, there is a lag between files being updated and view being refreshed.


0
 
LVL 4

Author Comment

by:Woodster
ID: 1025559
Is there a method of doing this within a single threaded application.  We use an application framework (not MFC) that doesn't seem to like being used in a a multi threaded environment so I am not sure if this solution is applicable.  

Even if using the method you described, how can I tell if a particular record has changed (relational database) without storing the original copy of the record in memory which could result in a large overhead if there are many records being displayed?

What is an n-tier solution?  Would a client/server type set up resolve this problem?  I have not used a Client/Server set up before so am unsure as to the implications of such a system.
0
 
LVL 3

Expert Comment

by:gmoriak
ID: 1025560
Client server generally ignores the problem without too many consequences.  Users don't typically update the same thing and when they do, you can simply display a message saying "Data changed etc."
0
 
LVL 4

Author Comment

by:Woodster
ID: 1025561
Sorry for the (exceptionally) late response.  The problem is, if I can't determine that the data has been changed, how can I display a message to inform the user?  Do you have any answers for the other questions in my previous comment?
0
 
LVL 3

Expert Comment

by:gmoriak
ID: 1025562
Have a lastMod_date column in your table.  Retrieve it when bringing back data and check to make sure it is the same when updating (put it in your where clause)  If it hasn't changed, you know that nobody has changed your data.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question