Solved

Data change notification in multi user environment

Posted on 1998-08-23
5
312 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 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now